Span text

Ian's Javascript Circle Intersect
Maths Test Demo

(Version 4.1 (for drop down menus) 3/8/17 )

View Page Source Code
View Javascript General Routines Include


Calculates the middle point x co-ordinate for a triangle specified by points P1, P2 and P3,
where points P1 and P3 are on the x axis, and point P2 is an arbitrary point
with x co-ordinate between points P1 and P3. (See diagram below.)

This isn't very clever as this value is known already.
The aim is to test the following equation, which doesn't use all the co-ordinate information avaialable to
the program.



View Derivation of the Equation


Circle Equation 1

 

Meaning of the symbols:
(See diagram lower.)

r1 is the length of the line between Points P1 and P2.
r2 is the length of the line between P2 and P3.
h1 is the length of the line between P2 and P4.
h2 is the length of the line between P4 and P3.
Rz is the length of the line bewteen P1 and P3.
α is the proportion of the length of Rz that h1 is.

The aim is to calculate α if only r1 , r2 and Rz are known.

This equation does that.

The program tests the equation, by creating points/lines you specify the co-ordinates of, then calculating r1 , r2 and Rz for
those lines, using the equation to calculate α, which should
then correspond totally accurately to the position
on line Rz corresponding to the x co-ordinate of P2,
so we can see if the equation is correct or not.

The program draws the position of α as an indicator line
in orange below the x-axis.

See also the calculation output text for the actual numbers.

 

 

 

.




All co-ordinate values are in screen pixels.
The current dimensions of the SVG image viewing area are: 650px x 400px.

To Demo the Program
Type in the co-ordinates you want, then click the Draw Diagram button to re-draw the diagram,
or click the Do Calculation button to redraw the diagram and use the equation to calculate alpha and the x co-ord of P2,
to see if the equation is valid.

(If you want to check it yourself use the values of r1 r2 and Rz from the calculation result text, and then use those
values in the formula with a calculator.)


Point 1(P1)(x co-ordinate only):
Point 2(P2)(x & y co-ordinates): x: , y:
Point 3(P3)(x co-ordinate only):
,


Error Report: err10 txt