PDA

Click to See Complete Forum and Search --> : HELP! Triangle in Circle Construction without Trig?


astro_girl_690
Dec 2nd, 2006, 09:59 PM
Hey guys! Am hoping some one might be able to shed some light on what I suspect is a fairly simple code problem
involving geometry.

I'm an intermediate level VB coder, but my math skills are so so.

So; :)

What I'm trying to do is just this;


Three points on a circle occur at different degrees. These points can be any degree and will vary. I want to find the
ANGLE of degree BETWEEN each point and its neighbour when the three points are viewed as a triangle. For instance;

Three points are generated ;

x = 49 degrees
y = 97 degrees
z = 311 degrees

Lets store the degree points in the above variables; x,y,z

The circle diameter is fixed at 10 units of measure, lets say we are using centimeters.


I want to know what the ANGLE of degree BETWEEN ;

Y_X_Z
Z_Y_X
Y_Z_X

Where the middle variable in the above represents the apex, zenith point of triangle, or the angle between the left and
right degree points


Manually, if I drew this out on paper and used a protractor to measure directly I'd find the degrees to work out as;


Y_X_Z
---------------------------------------
97-49-311 = 108 degrees


Z_Y_X
---------------------------------------
311-97-49 = 48 degrees


Y_Z_X
---------------------------------------
97-311-49 = 24 degrees


BUT how would I CODE this? I want to be able to enter ANY degree value on a circle for any of X,Y,Z.

Also, I'd like to be able to compute automatically the LENGTH of each triangle leg, each of the three lines
making up the triangle.

Importantly, I need to be able to get the angle and line length dimensions for triangles that do not neccessarily
intersect the circle center, radius at all, hence the above example of degrees on a circle of 49, 97 and 311 degrees,
this forms a triangle that does not intersect the circles center.

Can anyone help with some code snippets and hopefully especially any math formulas to derive these sorts of things?

I am familiar with trig functions like AAA, ASA, etc... but this dopes not seem to be what I am looking for since
I am working with a scenario where both triangle angles AND sides are unknowns - all that is known is the three
degree points on the circle that would form the triangle.

Thanks guys!!!

:)

zaza
Dec 3rd, 2006, 04:50 AM
Break it down by considering just two of the points, let's say the 49 and 97 degree points. Now draw lines from the centre of the circle to the edge at these points.
You know that these two lines are of the same length - they are the radius of the circle. Also you know the angle between them - it is 97-49 = 48 degrees. So you have an isoceles triangle in which you know the length of the same sides and you know one of the angles.

Now you can work out the other angles in this triangle at the edge of the circle - subtract from 180 and divide by two. You have 3 such triangles to consider in the circle, and so each of your angles X Y and Z are the sum of the pairs of these isoceles angles.
Also, since you have all the angles and the radius length, you can use the sine rule (sinA / a = sinB / b = sinC / c) or the cosine rule (a^2 = b^2 + c^2 - 2bc cos A) [where a, b, c are the lengths of the sides and A, B, C are the angles opposite to those sides] to work out the perimeter or anything else you'd care to imagine.

If you want to work out angles and sides, you're going to have to use trig I'm afraid.


Start by drawing as I suggested above and all will become clear.


zaza