I have two questions for this one. Both fairly basic, I think.
First, how do I find the angles for each vertex of a triangle knowing only the length of the three sides?
I tried the using
theta = arctan((m2-m1)/1(m1+m2))
where m1 and m2 are the slopes of the lines whose concurent vertex define the angle. This does work to return the angle of intersection in radians, but it always returns the 'smaller' side of intersection.
This creates a problem with obtuse triangles where the measurment returns the size of the 'exterior' angle on the obtuse vertex. Is there a better way to find the angle measurement or is there some way to force the radian measurement to return the interior angle?
For the second question, it's just me not remembering my high-school algebra ;) I'm trying to adapt the perpendicular bisector equation:
where x1,1y and x2,y2 are the endpoints of the segment I'm bisecting. What i'm trying to do with this is to solve without knowing 'x' *or* 'y', which if I'm remembering correctly means I will have two simultaneous equations.
I found an equation for finding the coordinates of a point dividing a segment in the ratio r/s:
x = (rX1+sX2)/(r+s) y = (rY1+sY2)/(r+s)
But I don't completely understand this one either. I haven't been able to figure out the 'r/s' part. I'm not sure how to define r/s to represent 'half-way'
Any help with either of these would be greatly appreciated.