AddDelphi Tips
Tips 31-40 of 94
Go to << Prior 1 2 3 4 5 6 7 8 9 10 Next >> page 
Determine if two 3D segments are perpendicular to each other - 28 March, 2004 - Arash Partow

Function SegmentsPerpendicular(x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4:Double):Boolean;
Var Dx1,Dx2 : Double;
Dy1,Dy2 : Double;
Dz1,Dz2 : Double;
Begin
{
The dot product of the vector forms of the...

Determine if two 2D segments are perpendicular to each other - 28 March, 2004 - Arash Partow

Function SegmentsPerpendicular(x1,y1,x2,y2,x3,y3,x4,y4:Double):Boolean;
Begin
Result:= IsEqual((y2-y1)*(x3-x4),(y4-y3)*(x2-x1)*-1);
End;
(* End Of SegmentsPerpendicular *)


Const Epsilon =...

Determine if two 3D segments are parallel to each other - 28 March, 2004 - Arash Partow

Function SegmentsParallel(x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4:Double):Boolean;
Var Dx1,Dx2 : Double;
Dy1,Dy2 : Double;
Dz1,Dz2 : Double;
Begin

{
Theory:
If the gradients in...

Determine if two 2D segments are parallel to each other - 28 March, 2004 - Arash Partow

Function SegmentsParallel(x1,y1,x2,y2,x3,y3,x4,y4:Double):Boolean;
Begin
Result := IsEqual(((y1-y2)*(x1-x2)),((y3-y4)*(x3-x4)));
End;
(* End Of SegmentsParallel *)

Const Epsilon = 1.0E-12;

Perpendicular Distance from Point to Segment - 28 March, 2004 - Arash Partow

Function PntToSegmentDistance(Px,Py,x1,y1,x2,y2:Double):Double;
Var Ratio : Double;
Dx : Double;
Dy : Double;
Begin
If IsEqual(x1,x2) And IsEqual(y1,y2) Then
Begin
Result :=...

Perpendicular from Point to Segment - 28 March, 2004 - Arash Partow

Procedure PerpendicularPntToSegment(x1,y1,x2,y2,Px,Py:Double; Var Nx,Ny:Double);
Var R : Double;
Dx : Double;
Dy : Double;
Begin
Dx := x2 - x1;
Dy := y2 - y1;
R :=...

Angle of 3D vertex - 28 March, 2004 - Arash Partow

Function VertexAngle(x1,y1,z1,x2,y2,z2,x3,y3,z3:Double):Double;
Var Dist : Double;
Begin
(* Quantify coordinates *)
x1 := x1 - x2;
x3 := x3 - x2;
y1 := y1 - y2;
y3 := y3 - y2;
z1 := z1...

Angle of 2D vertex - 28 March, 2004 - Arash Partow

Function VertexAngle(x1,y1,x2,y2,x3,y3:Double):Double;
Var Dist : Double;
Begin
(* Quantify coordinates *)
x1 := x1 - x2;
x3 := x3 - x2;
y1 := y1 - y2;
y3 := y3 - y2;

(*...

Determine the Point of intersection for two 2D segments - 28 March, 2004 - Arash Partow

Procedure IntersectPoint(x1,y1,x2,y2,x3,y3,x4,y4:Double; Var Nx,Ny:Double);
Var R : Double;
dx1,dx2,dx3 : Double;
dy1,dy2,dy3 : Double;
Begin
dx1 := x2 - x1;
dx2 := x4 - x3;
dx3...

Determine if two 2D segments intersect each other - 28 March, 2004 - Arash Partow

function Intersect(const x1,y1,x2,y2,x3,y3,x4,y4:Double):Boolean;
var UpperX,UpperY : Double;
LowerX,LowerY : Double;
Ax,Bx,Cx : Double;
Ay,By,Cy : Double;
D,F,E : Double;
...

Tips 31-40 of 94
Go to << Prior 1 2 3 4 5 6 7 8 9 10 Next >> page 
Latest News
Submit News Form Past News
Latest Forum Entries