how to rotate a filled area of integral in 2D graph

lcfactorization shared this question 2 years ago
Answered

Suppose the area is defined as


  1. integral(sin(x)^2,0,pi/2)

How to rotate it around a fixed point, e.g., (pi/4,1/2) at an arbitrary angle (slider between 0 and 360 degrees)?

I found it is impossible to use

  1. rotate(object,(pi/4,1/2,pi/6)

immediately.When I try to create a locus with a curve and two segments, so that I can rotate the parametric equations of the boundaries:

  1. curve(x,sin(x)^2,x,0,pi/2)
  2. segment((0,0),(pi/2,0))
  3. segment((pi/2,0),(pi/2,1))

but I cannot obtain the right filling effects desired. The shading is closely tied to the curve on its both sides.

And if there is any maloperation further, all objects that were created will disappear and cannot be undone.(The last one seems to be a bug in 5.0.379 but fixed in 5.0.380 )


Best Answer
photo

ya va haciendose famoso lo de crear un poligono auxiliar para estas cosas

perdon con juan carlos siempre escribo en español

It is famous already to create a polygon for this jobs

Files: foro.ggb

Comments (12)

photo
2

The Rotate( ) syntax is not correct.

You need to use Rotate(object,angle,point)

Please see the Rotate command wiki page.


Since the Integral command outputs a numerical value, it's impossible to apply the Rotate command to a number.

Now I'll try to find a complete answer to your question. In the meanwhile, the attached file contains the rotated area.

photo
1

Thank you. This works since all boundaries of the closed area can be rotate separately.

A further issue is, is it possible to fill the closed area with some specific pattern, and rotate the pattern while rotating the area?

I use `integral` or `integralBetween` because in such cases, the closed area can be filled with geogebra's built-in patterns.


In your answer, i tried to use `locus` command to create a new object, but found it difficult to fill the locus with a pattern. Do you have any idea?


thank you

photo
photo
2

Hi,

Maybe this file is useful.

Drag the sliders. Move the point A around.

Cheers!

photo
2

Actually, this one is better. I think...

You can change the function f(x), if you want.

Cheers!

photo
1

thank you! It seems you have used `sequence` command to create a customized new pattern for the area. This is very smart. -- I need to learn how to use such command like `sequence` in the future, the usage of which seems to be more flexible than those similar functions in Mathematica.

photo
photo
2

ya va haciendose famoso lo de crear un poligono auxiliar para estas cosas

perdon con juan carlos siempre escribo en español

It is famous already to create a polygon for this jobs

Files: foro.ggb
photo
1

I was also thinking about using "polygon" to approximate the closed area, but am not familiar with the implementation with Geogebra commands. This should be the best approach expected. Thank you so much!

photo
1

I agree.

photo
photo
2

Hi, tried with locus+polygons but not easy.

photo
2

The sine curve works, before reading your ideas I've used exactly the same function as an example to discuss with the developers some doubts that arised while trying to colour the area.

But please, try coloring the area under curve(x,sin(x)^2,x,0,pi/2)in (0,pi/2) rotated around (pi/4, 1/2)!


The locus method in my case fails. Because of the segment that joins the first and last vertex of the curve whenever opacity is set >0, that creates a coloring of an unwanted area.


I'm trying alternative ways to do that, but still have not created a satisfactory solution (I mean, not an obvious workaround)

photo
1

I met the problem when trying to create an animation for a "wordless proof" problem: http://blog.csdn.net/stereo...

Now it has been solved (see attached) via `polygon` approximation in the best answer by mathmagic.

I found the filling effects of both the `locus` version and the approximated `polygon` version of the curve (with the segment excluded) are similar. I do have a lot more expectations on Geogebra but can understand the difficulty in composing code and algorithm behind: e.g., the built-in-patterns do not rotate together with the area so the visual effects are not perfect; stronger LaTeX supports on text, legends, axis label objects and so on.

thank you for kind help!

photo
photo
2

I think mathmagic's approach is the best solution. You can choose any color or pattern to fill the area and you can choose any point on the plane to rotate the area.

© 2019 International GeoGebra Institute