dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: trig formula

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Posts
    147

    trig formula

    I need to make a trig function and I can't find any examples on this one: the challenge is to calculate an angle, when the lengths of all three sides of a triangle are known, but no angles are known.


    The only examples I can find assume that one angle of the triangle is already known. But there must be a way to do it if you know all three sides. Any suggestions?

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    you just need to use the law of cosines
    Code:
    cos A = (b + c - a) / 2bc
    cos B = (a + c - b) / 2ac
    cos C = (a + b - c) / 2ab
    so you can manipulate those around to just solve for the angle by doing:
    Code:
    A = ArcCos[(b + c - a) / 2bc]
    B = ArcCos[(a + c - b) / 2ac]
    C = ArcCos[(a + b - c) / 2ab]
    i hope that helps ya




    ps..this isnt actionscript, its just regular math

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center