Results 1 to 13 of 13
Like Tree4Thanks
  • 1 Post By Plato
  • 1 Post By emakarov
  • 1 Post By Soroban
  • 1 Post By Plato

Math Help - given one point, calculate remaining coordinates of square/triangle inside a circle..

  1. #1
    Newbie
    Joined
    Oct 2013
    From
    texas
    Posts
    6

    given one point, calculate remaining coordinates of square/triangle inside a circle..

    given one point, calculate remaining coordinates of square/triangle inside a circle..-trig_diagram_tri.pnggiven one point, calculate remaining coordinates of square/triangle inside a circle..-trig_diagram_quad.png
    two questions, on the same vein...

    the radius of the red circle is given, and its center point is always at 0,0.
    point A moves, tracing the path of the red circle.

    given point A, how would you calculate the remaining point coordinates to form the largest possible square within the red circle?
    given point A, how would you calculate the remaining point coordinates to form the largest possible equilateral triangle within the red circle?

    thanks!
    Last edited by wilbsy; October 28th 2013 at 08:13 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,607
    Thanks
    591

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Hey wilbsy.

    Have you taken a calculus course? If you know calculus you can solve this through an optimization problem.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,605
    Thanks
    1574
    Awards
    1

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by wilbsy View Post
    Click image for larger version. 

Name:	trig_diagram_tri.png 
Views:	2 
Size:	7.9 KB 
ID:	29615Click image for larger version. 

Name:	trig_diagram_quad.png 
Views:	1 
Size:	7.8 KB 
ID:	29616
    the radius of the red circle is given, and its center point is always at 0,0.
    point A moves, tracing the path of the red circle.

    given point A, how would you calculate the remaining point coordinates to form the largest possible square within the red circle?
    given point A, how would you calculate the remaining point coordinates to form the largest possible equilateral triangle within the red circle?
    Because this is posted in the trigonometry sub-forum it can be done without calculus.
    If  A: (x,y) is any point on a circle centered at (0,0) with radius r there is unique equilateral triangle inscribed in the circle with a vertex at A.

    Suppose that x\cdot y\ne 0 then
     \theta = \left\{ {\begin{array}{{ll}}  {\arctan \left( {\frac{y}{x}} \right),}&{x > 0} \\   {\arctan \left( {\frac{y}{x}} \right) + \pi ,}&{x < 0\;\& \;y > 0} \\   {\arctan \left( {\frac{y}{x}} \right) - \pi ,}&{x < 0\;\& \;y < 0} \end{array}}\right.

    The angle \theta is the angle \overrightarrow {OA} makes with the positive x-axis.
    The coordinates of A can now be written as (r\cos(\theta),r\sin(\theta)

    Here are the coordinates of the other vertices: \left( {r\cos \left( {\theta  + \frac{{2k\pi }}{3}} \right),r\sin \left( {\theta  + \frac{{2k\pi }}{3}} \right)} \right),~k=1,~2.

    In case of the square, do the exact same steps using
    \left( {r\cos \left( {\theta  + \frac{{2k\pi }}{4}} \right),r\sin \left( {\theta  + \frac{{2k\pi }}{4}} \right)} \right),~k=1,~2,~3
    Thanks from wilbsy
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,513
    Thanks
    769

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by Plato View Post
    Here are the coordinates of the other vertices: \left( {r\cos \left( {\theta  + \frac{{2k\pi }}{3}} \right),r\sin \left( {\theta  + \frac{{2k\pi }}{3}} \right)} \right),~k=1,~2.
    Also note that through the formulas for the cosine and sine of a sum, the other coordinates are expressible through the given ones, so there is no need to compute θ explicitly. This works whether xy = 0 or not.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Oct 2013
    From
    texas
    Posts
    6

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    posting error... lo siento.
    Last edited by wilbsy; October 29th 2013 at 11:53 AM.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Oct 2013
    From
    texas
    Posts
    6

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by emakarov View Post
    Also note that through the formulas for the cosine and sine of a sum, the other coordinates are expressible through the given ones, so there is no need to compute θ explicitly. This works whether xy = 0 or not.
    could you elaborate with pseudo code?

    thanks
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Oct 2013
    From
    texas
    Posts
    6

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by chiro View Post
    Hey wilbsy.

    Have you taken a calculus course? If you know calculus you can solve this through an optimization problem.
    i took some pre-cal years ago, but even in that my working knowledge is definitely sub-par. i'd be curious to know the calculus approach to this problem... i'm using these equations in a program, so it's always good to know all the potential methods in order to optimize the code.

    would it be appropriate to continue on this thread? or should we move it over to the calculus sub-forum?

    thanks!
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,513
    Thanks
    769

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by wilbsy View Post
    could you elaborate with pseudo code?
    If you rotate a point (x, y) by \phi radians counterclockwise around the origin (in the case of the triangle, \phi=2\pi/3 and for the square \phi=\pi/2), the new coordinates are x'=x\cos\phi-y\sin\phi and y'=x\sin\phi+y\cos\phi. In matrix form,

    \begin{pmatrix}x'\\y'\end{pmatrix} =\begin{pmatrix}\cos\phi & -\sin\phi\\\sin\phi & \cos\phi\end{pmatrix} \begin{pmatrix}x\\y\end{pmatrix}.

    Some languages have libraries for 2D drawing that include transformations, in particular, rotation. For example, in Java there is a class AffineTranformation and a function that returns an object of this class that performs rotation. You can use this object to transform individual points, shapes or the entire canvas. This way, you don't necessarily have to understand how matrices inside AffineTranformation work.

    Quote Originally Posted by wilbsy View Post
    i'd be curious to know the calculus approach to this problem...
    Here calculus can be used only to make sure that the vertices of the largest triangle lie on the circle, which is obvious anyway.
    Thanks from wilbsy
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,676
    Thanks
    608

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Hello, wilbsy!

    The radius of the circle is given, and its center point is at (0,0).

    Given point A, how would you calculate the remaining point coordinates
    to form the largest possible square within the circle?

    With a square, no trigonometry or calculus is needed.

    Suppose vertex A is in Quadrant I with coordinates (p,q).
    Then the other vertices are easily located.

    Code:
                    |
              D   * * *
        (-q,p)o     |     *
            *       |       * A
           *        |        o(p,q)
                    |
          *         |         *
      - - * - - - - + - - - - * - -
          *         |         *
                    |
    (-p,-q)o        |        *
          C *       |       *
              *     |     o(q,-p)
                  * * *   B
                    |
    Thanks from wilbsy
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Newbie
    Joined
    Oct 2013
    From
    texas
    Posts
    6

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by Soroban View Post
    With a square, no trigonometry or calculus is needed.

    Suppose vertex A is in Quadrant I with coordinates (p,q).
    Then the other vertices are easily located.
    wow, the simplicity is striking... seems too easy to be true.
    thanks!
    Follow Math Help Forum on Facebook and Google+

  11. #11
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,605
    Thanks
    1574
    Awards
    1

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by wilbsy View Post
    seems too easy to be true.
    It is too easy and wrong. It does not give you a square.

    The method does give a rectangle the sides of which are parallel to the principal axises.
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,838
    Thanks
    320
    Awards
    1

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by Plato View Post
    It is too easy and wrong. It does not give you a square.

    The method does give a rectangle the sides of which are parallel to the principal axises.
    Whereas I think that Soroban should have provided a method or at least hints to get to his solution we can calculate that the quadrilateral has two pairs of parallel sides, the sides all meet at right angles, and all sides have the same length...these points form a square.

    -Dan
    Follow Math Help Forum on Facebook and Google+

  13. #13
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,605
    Thanks
    1574
    Awards
    1

    Re: given one point, calculate remaining coordinates of square/triangle inside a circ

    Quote Originally Posted by topsquark View Post
    Whereas I think that Soroban should have provided a method or at least hints to get to his solution we can calculate that the quadrilateral has two pairs of parallel sides, the sides all meet at right angles, and all sides have the same length...these points form a square.
    Two of us saw the post as a graphics programming problem. That was to focus of replies #3 & #8.

    As for the other matter, good luck in changing behavior there.
    Thanks from topsquark
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. prove , ray of circle inside the square
    Posted in the Geometry Forum
    Replies: 1
    Last Post: July 9th 2013, 05:40 AM
  2. Circle inside a square
    Posted in the Trigonometry Forum
    Replies: 2
    Last Post: August 11th 2011, 04:32 AM
  3. from the point inside the square
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: December 3rd 2010, 04:04 AM
  4. Point inside circle
    Posted in the Geometry Forum
    Replies: 2
    Last Post: July 19th 2010, 07:11 PM
  5. Point inside circle
    Posted in the Geometry Forum
    Replies: 0
    Last Post: March 7th 2010, 09:24 AM

Search Tags


/mathhelpforum @mathhelpforum