Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ligh

triangle math

This topic is 5591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i hope this picture works..
                         .
          C         .    |
               .         |
          .    |         | 300
     .         |x        |
.              |         |
---------------|---------|
     400           a
 
if i have this triagle., how, if possible, would i find the length of x thanks! [grhodes_at_work edited to correct the display of the picture] [edited by - grhodes_at_work on February 3, 2003 5:43:15 PM]

Share this post


Link to post
Share on other sites
Advertisement
Homework problems cannot be answered on this board, or at least not until you have shown some work.

Share this post


Link to post
Share on other sites
it''s not for homework., this is a board for helping with math and physics, is it not?


Im trying to figure out the size to scale a picture using a sort of raycasting technique. The 300 line is how big half of the height of the pic would be if you were 0 units from the object, the middle line is 400 units away from the object and 2x would be the projected height of the object. I cant get the math right..
i know the angle in the bottom left corner (aC) is

aC = tan(300/(400+a))

then using the F pattern the inside angle and the other angle of the triangle are equal.

but i can seem to find the equation to get x.

Share this post


Link to post
Share on other sites
The ratio of the sides of the small triangle is the same as the ratio of the sides of the large triangle. So we know that 400/x = (400+a)/300. Now you can easily express x as a function of a.

Share this post


Link to post
Share on other sites
quote:
Original post by ligh
it''s not for homework., this is a board for helping with math and physics, is it not?



The answer to your question is yes, BUT with a condition. This forum focuses on solving practical problems in math & physics related to game development. Not math and physics in general. Read the forum FAQ (link available at the top of the list of topics and below) to learn more about forum policy.

Forum FAQ

You''ll find that people in this forum are always on the lookout for students trying to get essentially free answers to homework questions, and if you do not explain simple posts such as yours and show your work, many folks will assume you are asking a homework question.

quote:
Original post by ligh
Im trying to figure out the size to scale a picture using a sort of raycasting technique.


That falls close enough to the category of game development, so your post is OK.


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
You have two similar triangles, one within the other. Since lengths of corresponding sides are proportional,

x/(400-a) = 300/400

This assumes that 400 is the length of the entire bottom edge of the large triangle. If 400 is the length of the bottom of the smaller triangle (I can''t tell which of tehse options it is from the ASCII art), then you have this proportionality:

x/400 = 300/(400+a)

In either case, just solve for x.

Share this post


Link to post
Share on other sites
i figured it out.. i mixed up the a and the 400, and i forgot to put in 30 as the angle of aC.. which is 1/2 of 60, my fov.

thanks for the help anyway

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!