Advertisement

triangle math

Started by February 02, 2003 01:31 PM
7 comments, last by ligh 22 years ago
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]
the pic didn''t work., go to http://www.logo3.net/tri.jpg for a pic. thanks!
Advertisement
Homework problems cannot be answered on this board, or at least not until you have shown some work.
That''s math for 13-years-olds, isn''t it? Look up for Thales in your elementary school books :-p

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more
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.

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.
Advertisement
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.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
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.
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

This topic is closed to new replies.

Advertisement