drag the points to make a right triangle. press 1/2 to show or hide the points. ============[HOW THIS WORKS]============= points ABC are used. A is red, B is green, and C is the result of making the triangle. sides are referred to based on the origin of angle A. we start by getting the angle relative from A to B. here is the formula: (((atan(Δy / Δx)) + 90 ) - (180 * ((Δx + (|Δx| / 2) ≥ 0))) * -1) this gets our angle of AB (shown as θ. the delta values are also shown in variables) now that we have the ADJ side, we need to find the OPP side. this is just rotating counterclockwise 90 degrees, then doing this: θ=θ-90 x = x+(sin(θ)*Δx) y=y+(cos(θ)*Δx) next, we can go back to point A from point C, making AC. mathematically, we reuse the same angle finding formula from the first bit to get the angle, and the distance formula which is this: √(x2-x1)^2 + (y2-y1)^2 For the angles, m∠B is given; it is equal to 90. for m∠A, we can calculate with simple trigonometry. In high school, you learned SOH CAH TOA, sinθ(x)=OPP/HYP, cosθ(x)=ADJ/HYP, and tanθ(x)=OPP/ADJ. you also learn that arcSine, arcCosine, and arcTangent is the inverse of the corresponding theorem. To find the angle using sides, we would need to get the side lengths, and use the inverse of sine to get our answer. to get m∠A, we do this; m∠A = asin(OPP/HYP) and finally, we can get m∠C by doing simple geometry; 180 - (90 + m∠A) = m∠C
================[EXAMPLE]=============== points: A=(3, 4), B=(1, 8) Δx=-2 Δy=4 AB=√-2^2 + 4^2 AB=4.472 θAB= ((((atan(Δy/Δx)+90) - (180 * ((Δx + (|Δx| / 2)) ≥ 0))) * -1)° ((((atan(-4/2)+90) - (180 * ((-2 + (|-2| / 2)) ≥ 0))) * -1)° ((((atan(-2)+90) - (180 * ((-2 + (2 / 2)) ≥ 0))) * -1)° ((((-63.434)+90) - (180 * ((-2 + 1) ≥ 0))) * -1)° (((26.564 - (180 * 0)) * -1)° ((26.564 - 0) * -1)° (26.564 * -1)° θAB = -26.594° θ = (-26.594 - 90)° θ = -116.594° Xc = Xb + (sin(-116.594)*-2) Xc = 8 - 1.788 Xc = 6.211 Yc = Yb + (cos(-116.594)*-2) Yc = 1 - 0.906 Yc = 0.093 ⊿ABC{A=(3, 4), B=(1, 8), C=(6.211, 0.093)} ADJ = 4.472, OPP = -2, HYP = 4.898 m∠A = (asin(OPP/HYP))° m∠A = (asin(-2/4.898))° m∠A = -24.094° m∠C= (180 - (90 + -24.094))° m∠C = (180 - 65.906)° m∠C = 114.094° m∠B = 90° m∠A = -24.094° m∠C = 114.09° SOLUTION: ⊿ABC = {A=(3, 4), B=(1, 8), C≈(6.211, 0.093)} ADJ = 4.472 OPP ≈ -2 HYP ≈ 4.898 m∠B ≈ 90° m∠A ≈ -24.094° m∠C ≈ 114.094° θAB ≈ 153.434°