Thursday, November 17, 2016

HP Prime and TI-84 Plus: Forward Intersection

HP Prime and TI-84 Plus:  Forward Intersection

Introduction

The program FORDINT calculates the third point on a triangle where the coordinates of points A  (xa, xb) and B (xb, yb) are known.  Also, a line towards P point is aimed from point A at angle α° and from point B at angle β°.  See the diagram below.



Formulas:

Output is point P:
xp = (xa cot β + xb cot α + (yb – ya))/(cot α + cot β)
yp = (ya cot β + yb cot α + (xa - xb))/(cot α + cot β)
γ = 180° - α - β

cot θ  = 1/tan θ

Note that FORDINT will set the calculator to Degrees mode.



HP Prime Program FORDINT

Input:  xa, ya, α, xb, yb, β
Output:  3 element list:  {xp, yp, γ} and Degrees mode is set

EXPORT FORDINT(xa,ya,a,xb,yb,b)
BEGIN
// Forward Intersection
// 2016-11-16 EWS

LOCAL xp,yp,c;
// Degree Mode
HAngle:=1;
// Calculation
xp:=(xa*COT(b)+xb*COT(a)+(yb-ya))
/(COT(a)+COT(b));
yp:=(ya*COT(b)+yb*COT(a)+(xa-xb))
/(COT(a)+COT(b));
c:=180-a-b;
RETURN {xp,yp,c};
END;


TI-84 Plus Program:  FORDINT

Input:  Variables are prompted
Output:  Results are displayed 

Variable
TI-84 Plus Variable
Variable
TI-84 Plus Variable
Variable
TI-84 Plus Variable
xa
N
ya
S
α
A
xb
O
yb
T
β
B
xp
P
yc
U
γ
C

"FORWARD INTERSECT"
"2016-11-16 EWS"
Degree
Input "XA: ",N
Input "YA: ",S
Input "θA: ",A
Input "XB: ",O
Input "YB: ",T
Input "θB: ",B
(N/tan(B)+O/tan(A)+(T-S))/(1/(tan(A))+1/(tan(B)))→P
(S/tan(B)+T/tan(A)+(N-O))/(1/(tan(A))+1/(tan(B)))→U
180-A-B→C
Disp "XP: ",P
Disp "YP: ",U
Disp "θC: ",C

Example:
Point A:  (1000, 950), angle towards point P:  30°
Point B:  (1012, 997), angle towards point P:  44°

Result:
Point P:  (approximately) (1024.49237, 975.078358)
Angle γ: 106°

Source: Casio.   Casio fx-FD10 Pro User’s Guide Tokyo. 2014

This blog is property of Edward Shore, 2016.