Unit CastleLine2DMath
Description
The module contains some mathematical methods, as well as methods for constructing some primitives.
Overview
Functions and Procedures
function DoFloat(var StringValue:string;const Remain:string=''):single; |
function PSDistanceEx(const P,SP1,SP2:TVector2;var Distance:Single; var PP:TVector2):integer; |
function CrossingSegments(const a1,a2,b1,b2:TVector2; var CrossPoint:TVector2):shortint; |
function IsClockwiseTriangle(A,B,C:TVector2):boolean; |
function AddArcBetweenPoints(var Arc:TVector2List; const Center,O,A,B:TVector2; const EdgesCount:integer):single; |
procedure AddRoundBoxTop(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2; const EdgesCount:integer); |
procedure AddHalfCircle(var Arc:TVector2List; const A,B:TVector2; const EdgesCount:integer; const Opposite:Tvector2); |
procedure AddTriangle(var Arc:TVector2List; const A,B,C:TVector2); |
procedure AddTriangleOpposite(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
procedure AddTriangleTop(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
procedure AddHalfBox(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
procedure AddBox(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
procedure AddRect(var Arc:TVector2List; const A,B:TVector2; width:single); |
function AddCrossSegments(var Arc:TVector2List; const O,A1,A2,B1,B2:TVector2):single; |
function DoGoodTriangle(var Lt:TVector2List; A,B,C:integer; Scale:TVector2):boolean; |
Description
Functions and Procedures
function DoFloat(var StringValue:string;const Remain:string=''):single; |
Converts StringValue to a number by removing the excess. Remain is a non-removable remainder in a string (can be used to ensure that the '-' at the beginning of the line is not deleted) |
function PSDistanceEx(const P,SP1,SP2:TVector2;var Distance:Single; var PP:TVector2):integer; |
The minimum distance from the point(P) to the segment(SP1:SP2) with the calculation of the projection point (PP) on the segment. 0 - the point is projected onto the segment: Distance = distance from P to the segment SP1,SP2. PP |
function CrossingSegments(const a1,a2,b1,b2:TVector2; var CrossPoint:TVector2):shortint; |
Intersection of segments A1:A2, B1:B2 |
function IsClockwiseTriangle(A,B,C:TVector2):boolean; |
If the order of traversal of triangle A,B,C is clockwise, then returns |
function AddArcBetweenPoints(var Arc:TVector2List; const Center,O,A,B:TVector2; const EdgesCount:integer):single; |
Builds an arc between points A,B with the center at the point Center |
procedure AddRoundBoxTop(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2; const EdgesCount:integer); |
Builds a square with one corner rounded on the segment A:B in the direction opposite to the Opposite. EdgesCount - the number of arc segments. Result = arc length. |
procedure AddHalfCircle(var Arc:TVector2List; const A,B:TVector2; const EdgesCount:integer; const Opposite:Tvector2); |
Builds a semicircle on the segment A:B in the opposite direction Opposite |
procedure AddTriangle(var Arc:TVector2List; const A,B,C:TVector2); |
Adds a triangle to the Arc |
procedure AddTriangleOpposite(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
Builds a rectangular isosceles triangle on the segment A:B in the opposite direction Opposite. Hypotenuse - A:B |
procedure AddTriangleTop(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
Builds a rectangular isosceles triangle on the segment A:B in the direction opposite to the Opposite. Hypotenuse - A:New Point |
procedure AddHalfBox(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
Builds a half square on the segment A:B in the opposite direction Opposite |
procedure AddBox(var Arc:TVector2List; const A,B:TVector2; const Opposite:Tvector2); |
Builds a square on the segment A:B in the opposite direction of the Opposite. |
procedure AddRect(var Arc:TVector2List; const A,B:TVector2; width:single); |
Builds a rectangle whose axis of symmetry is the segment A:B. |
function AddCrossSegments(var Arc:TVector2List; const O,A1,A2,B1,B2:TVector2):single; |
Adds triangles to connect two segments at the intersection point outside of these segments. A1:A2 the first segment. B1:B2 is the second segment. O is the junction point of the triangles. |
function DoGoodTriangle(var Lt:TVector2List; A,B,C:integer; Scale:TVector2):boolean; |
Sorts the vertices of the triangle in clockwise traversal order depending on the "Scale" (in the 2nd and 4th quarters, the order of traversal changes). If changes have been made (B and C have been swapped), it will return true. |
Generated by PasDoc 0.16.0.