Results 1 to 6 of 6

Math Help - Simple Trig Help

  1. #1
    Newbie
    Joined
    Sep 2010
    Posts
    3

    Simple Trig Help

    I like doing programming but I have a roadblock when it comes to math. As sad as it is, I'm probably the worst at math in my programming class. Don't know why. But for fun I'm making a tree algorithm to generate a branching tree graphic that I will use later. The problem I'm having is with simple trigonometry. Each limb will generate 2 more limbs off of it that is 1/2 the size and pointed in a random direction. All I need to do is generate a random number that is the angle the branch is pointing. But when I record the x/y coordinates the angle does not matter, just the starting and ending x/y coordinates. Here is a graphic I've done to illustrate what I'm trying to find-



    I've tried drawing some right triangles to see if something would click for me but no luck xD
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member Educated's Avatar
    Joined
    Aug 2010
    From
    New Zealand
    Posts
    430
    Thanks
    12

    Refer to my edited image of your branch.

    Since the angle counterclockwise from A to B is 290 degrees, we can find the angle of BAC by subtracting 270 from it.

    Once you have that angle BAC or CBA, you can solve the triangle using the sine/cosine rule. All you need to know is the length AC and BC. Once you have those lengths, you can add them to the co-ordinates of A(800,600) to get the co-ordinates of B.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Sep 2010
    Posts
    3
    I can't see your image so I'm not really understanding.

    1. Why would subtracting 270 from 290 give us BAC? AC could change without ever affecting the angle of AB.
    2. I already know the lengths of AB and AC. It's 30 units. But they do not necessarily form right angles (and do not in the illustration either).
    3. Adding 30 to (800, 600) would give me the coordinates of the branch if it were at a perfect 45 degree angle and grew %50 the original size.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member Educated's Avatar
    Joined
    Aug 2010
    From
    New Zealand
    Posts
    430
    Thanks
    12


    Can you see my image now?

    The reason why you are not getting it is beacuse you don't know where point C is, because you couldn't see my edited diagram.

    2. AC is NOT 30 units. AB is 30 units, you need to use trig to find length AC and BC. You need to make it a right angle triangle yourself to solve it.

    3. It is not 30 units vertical and horizontal.

    Simple Trig Help-branch.png
    Last edited by Educated; September 25th 2010 at 01:47 AM. Reason: Image attachment
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Sep 2010
    Posts
    3
    So according to your graphic



    sin(20) = x/30 ?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Senior Member Educated's Avatar
    Joined
    Aug 2010
    From
    New Zealand
    Posts
    430
    Thanks
    12
    Correct. That is for the length BC. For the length AC, you would use cosine.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Simple Trig Help #2
    Posted in the Trigonometry Forum
    Replies: 3
    Last Post: December 14th 2009, 03:59 AM
  2. Simple trig help!
    Posted in the Trigonometry Forum
    Replies: 20
    Last Post: December 12th 2009, 06:17 PM
  3. simple trig
    Posted in the Trigonometry Forum
    Replies: 3
    Last Post: April 13th 2009, 07:09 AM
  4. Simple trig
    Posted in the Trigonometry Forum
    Replies: 2
    Last Post: February 8th 2009, 11:40 AM
  5. simple trig
    Posted in the Trigonometry Forum
    Replies: 2
    Last Post: July 28th 2008, 03:10 AM

Search Tags


/mathhelpforum @mathhelpforum