perpendicular_2D: THEORY %---------------------------------------------------------------------------- % % Q. % .\ . % . \ . % . \ . d % . \ . . % . \ . . W = Q - P0 % W . c \ . . % . \ * P0 + t*v % . \ . del = (t-tp)*v % . * % . . P0 + tp*v % . . % .. % P0 % % % determine tp = intersection of perpendicular line from Q to line (P0,v) % = perp_pt(Q-P0,nzv) = (W*v)/(v*v) % c = length of this perpendicular line % del = (t-tp)*v % % dist(q,L) = distance from point q to line defined by perpendicular % % perpL(v), perpR(v) = return vector perpendicular to v % % Author: Ricky Butler NASA Langley Research Center % %---------------------------------------------------------------------------- BEGIN
IMPORTING vectors_2D
t,tp: VAR real
P0,Q,u,v,w,c,d,x,y,del: VAR Vect2
perpR(v): Vect2 = (v`y,-v`x) %% RIGHT turn
perpL(v): Vect2 = (-v`y,v`x) %% LEFT turn
neg_perpL : LEMMA
perpL(-v) = -perpL(v)
neg_perpR : LEMMA
perpR(-v) = -perpR(v)
perpL_perpR : LEMMA
perpL(v) = -perpR(v)
dot_perpR_eq_0 : LEMMA v*perpR(v) = 0
dot_perpL_eq_0 : LEMMA perpL(v)*v = 0
dot_perpR_scal_eq_0 : LEMMA v*perpR(t*v) = 0
dot_perpL_scal_eq_0 : LEMMA perpL(t*v)*v = 0
sqv_perpR: LEMMA pendicular_2D: THEORY
sqv_perpL : LEMMA sqv(perpL(v)) = sqv(v)
perpR_add : LEMMA
perpR(u+v) = perpR(u)+perpR(v)
perpR_sub : LEMMA
perpR(u-v) = perpR(u)-perpR(v)
perpR_scal : LEMMA
perpR(t*v) = t*perpR(v)
perpR_neg : LEMMA
perpR(-u) = -perpR(u)
perpR_eq_zero : LEMMA
perpR(zero) = zero
perpL_add : LEMMA
perpL(u+v) = perpL(u)+perpL(v)
perpL_sub : LEMMA
perpL(u-v) = perpL(u)-perpL(v)
perpL_scal : LEMMA
perpL(t*v) = t*perpL(v)
perpL_neg : LEMMA
perpL(-u) = -perpL(u)
perpL_eq_zero : LEMMA
perpL(zero) = zero
perpL_plus_perpR : LEMMA
perpL(v) + perpR(v) = zero
perp_is_normal: LEMMA tp = perp_pt(Q,P0,nzv) IMPLIES LET c = (P0 + tp%----------------------------------------------------------------------------
del = (t-tp)*nzv IN
del*c =java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 37
perp_is_min: LEMMA tp = perp_pt(Q,P0,nzv) IMPLIES LET d = (P0 + t*nzv - ,
c=(P0 +tpnzv)- QIN
norm(d) P0Qu,,w,d,,y,del:VARVect2
perp_gt_del: LEMMA tp = IMPLIES
d = P0+tnzv ,
= (-tpnzvjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
norm(d
: v*(t) 0 IMPLIES LET d = (P0 + t*nzv) - Q,
c = (0+tpnzv - Qjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
=()*nzvIN
sq(norm(d)) = sq(norm(del)
: java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
(()+tpv(),java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
: on_line?p,)IMPLIES
dist(q,p) >= dist (t*v t*(v
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
perpendicular(L1L2:bool=orthogonal((),vL2)