size : 1232
uploaded_on : Tue Apr 6 00:00:00 1999
modified_on : Wed Dec 8 14:03:37 1999
title : Angle between points
org_filename : AngleBetweenPoints.txt
author : Ulli Conrad
authoremail : uconrad@gmx.net
description : How to calculate the angle between two points in a coordinate system
keywords :
tested : not tested yet
submitted_by : The CKB Crew
submitted_by_email : ckb@netalive.org
uploaded_by : nobody
modified_by : nobody
owner : nobody
lang : pas
file-type : text/plain
category : pascal-alg-maths
__END_OF_HEADER__
function AngleBetweenPoints(P1,P2 : TPoint) : real;
function Distance(P1,P2 : TPoint) : real;
var
a,b,c : Longint;
begin
if P1.x>P2.x then
a:=P1.x-P2.x
else
a:=P2.x-P1.x;
if P1.y>P2.y then
b:=P1.y-P2.y
else
b:=P2.y-P1.y;
c:=(a*a)+(b*b);
Distance:=sqrt(c);
end;
var
r,c,s : real;
t : real;
co : real;
w : real;
begin
{ special cases }
if P1.x=P2.x then
begin
if P2.yP1.x) and (P2.yP2.x) and (P2.yP2.x) and (P1.yP1.x) and (P1.y