Results 1 to 6 of 6

Math Help - calculating the coordinates of an equliateral triangle (especially when rotated)

  1. #1
    Newbie
    Joined
    Jun 2010
    Posts
    3

    calculating the coordinates of an equliateral triangle (especially when rotated)

    calculating the coordinates of an equliateral triangle (especially when rotated)-triangle.gif
    Above is a diagram to help people understand what I'm looking for. This is for a Flash Actionscript 3 project I'm working on.

    Ultimately, what I want to be able to do is draw a nice sine curve on any angle, like at the top right of the image. To achieve this I need to calculate the coordinates of a triangle. I can then use C as the control points when using curveTo(); in actionscript the cursor is set to a point (x,y) using moveTo(x,y), then a curved line can be drawn to a second point with a control point defining the curve curveTo(ctrlX,ctrlY,x2,y2).

    I found some maths online that looked like it would answer my question, but from the way it was written I've struggled to fully understand it. You can see it here:
    ActionScript.org Forums - View Single Post - maths....HELP!Coordinates for point C of an equilateral triangle given points A and B

    So, to explain the diagram above, and what I understand:
    A (x1,y1) and B (x2,y2) are known as these are the start and end points of my line. D (x4,y4) I also know as these can be calculated from A and B as in the formula above.
    Also known is M1, the gradient of the line AB, as calculated in the formula above. I think I need to know M2 (the gradient of line CD) as well, but am unsure how to calculate this correctly. As the triangle is equilateral all internal angles are 60 degrees.

    So, what I need to know is how to calculate C (x3,y3) given the information above.

    Can anybody help me with the maths to calculate x3,y3 please?

    I know it's doable, my maths just isn't good enough

    BTW The coordinates of a Flash movie (0,0) start in the top left hand corner.

    NB The fact that y1 and y2 have different values is important when it comes to drawing the line. I have a feeling it would be much easier if they were the same, but that's not what I need.

    Any help would be gratefully received. Please go gently on me in any answer, as maths isn't my strong point.

    Many thanks

    Barry
    Attached Thumbnails Attached Thumbnails calculating the coordinates of an equliateral triangle (especially when rotated)-triangle.png  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    If M1 is vertical or horizontal, you should be able to solve easily. Otherwise, M1 and M2 are negative reciprocals, meaning M1*M2 = -1. Can you continue from here?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jun 2010
    Posts
    3
    Sadly, no. Negative reciprocals means nothing to me. I've googled the term, I understand from this that the function can be swapped around. Therefore, if I know m1 already, to find m2 I do
    m2 = m1 * -1
    Correct?
    That said, I have worked out the coordinates for the triangle when it is horizontal or vertical. Some progress at least.
    It's a long times since I did this stuff in Maths class, and wasn't great at maths anyway :-|
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by urbanclearway View Post
    Sadly, no. Negative reciprocals means nothing to me. I've googled the term, I understand from this that the function can be swapped around. Therefore, if I know m1 already, to find m2 I do
    m2 = m1 * -1
    Correct?
    That said, I have worked out the coordinates for the triangle when it is horizontal or vertical. Some progress at least.
    It's a long times since I did this stuff in Maths class, and wasn't great at maths anyway :-|
    Well it's M2 = -1/M1, and you can find the equation of the dashed line (the altitude) in your diagram using the point-slope equation, and you can then either use the distance formula or the equation for a circle (which amount to the same thing) to find the third vertex... I guess this won't be enough for you though; I have other responsibilities and won't be able to post for a while, so someone else might fill in the details.. and there could be an easier method too.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Jun 2010
    Posts
    3
    Cool. Actually that helps a lot, as I can go off and find those equations and attempt to string it all together. Otherwise I'm just dealing with abstract equations, that I'm not entirely sure of the purpose of.
    Slowly, slowly catchee monkey! :-)

    Thank you for the help.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by urbanclearway View Post
    Cool. Actually that helps a lot, as I can go off and find those equations and attempt to string it all together. Otherwise I'm just dealing with abstract equations, that I'm not entirely sure of the purpose of.
    Slowly, slowly catchee monkey! :-)

    Thank you for the help.
    Glad it helped! I have time to mention briefly another method; I'm not sure if it would be easier or harder. Find the length of a side, call it r. Then write down the equation for a circle centered at vertex 1 with radius r and the equation for a circle centered at vertex 2 with radius r, and find where they intersect. (There will be two intersection points.)
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Calculating an angle in 3D coordinates
    Posted in the Geometry Forum
    Replies: 8
    Last Post: September 6th 2011, 01:15 PM
  2. Calculating Coordinates
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: March 14th 2010, 10:23 PM
  3. calculating coordinates for a pattern
    Posted in the Algebra Forum
    Replies: 2
    Last Post: March 1st 2010, 03:29 PM
  4. Equliateral Triangle inscribed in circle
    Posted in the Geometry Forum
    Replies: 2
    Last Post: February 6th 2010, 04:27 PM
  5. Help with calculating coordinates.
    Posted in the Algebra Forum
    Replies: 1
    Last Post: October 12th 2009, 06:16 PM

Search Tags


/mathhelpforum @mathhelpforum