Struct Segment2d
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public struct Segment2d : IParametricCurve2d
Constructors
Segment2d(Vector2d, Vector2d)
Declaration
public Segment2d(Vector2d p0, Vector2d p1)
Parameters
Segment2d(Vector2d, Vector2d, Double)
Declaration
public Segment2d(Vector2d center, Vector2d direction, double extent)
Parameters
Fields
Center
Declaration
Field Value
Direction
Declaration
public Vector2d Direction
Field Value
Extent
Declaration
Field Value
Properties
ArcLength
Declaration
public double ArcLength { get; }
Property Value
HasArcLength
Declaration
public bool HasArcLength { get; }
Property Value
IsClosed
Declaration
public bool IsClosed { get; }
Property Value
Declaration
public bool IsTransformable { get; }
Property Value
Length
Declaration
public double Length { get; }
Property Value
P0
Declaration
public Vector2d P0 { get; set; }
Property Value
P1
Declaration
public Vector2d P1 { get; set; }
Property Value
ParamLength
Declaration
public double ParamLength { get; }
Property Value
Methods
Clone()
Declaration
public IParametricCurve2d Clone()
Returns
DistanceSquared(Vector2d)
Declaration
public double DistanceSquared(Vector2d p)
Parameters
Returns
DistanceSquared(Vector2d, out Double)
Declaration
public double DistanceSquared(Vector2d p, out double t)
Parameters
Returns
Endpoint(Int32)
Declaration
public Vector2d Endpoint(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
FastDistanceSquared(ref Vector2d, ref Vector2d, ref Vector2d)
distance from pt to segment (a,b), with no square roots
Declaration
public static double FastDistanceSquared(ref Vector2d a, ref Vector2d b, ref Vector2d pt)
Parameters
Returns
Intersects(Segment2d, Double, Double)
Declaration
public bool Intersects(Segment2d seg2, double dotThresh = 4.94065645841247E-324, double intervalThresh = 0)
Parameters
Returns
Intersects(ref Segment2d, Double, Double)
Test if segments intersect. Returns true for parallel-line overlaps.
Returns same result as IntrSegment2Segment2.
Declaration
public bool Intersects(ref Segment2d seg2, double dotThresh = 4.94065645841247E-324, double intervalThresh = 0)
Parameters
Returns
NearestPoint(Vector2d)
Declaration
public Vector2d NearestPoint(Vector2d p)
Parameters
Returns
PointAt(Double)
Declaration
public Vector2d PointAt(double d)
Parameters
Type |
Name |
Description |
Double |
d |
|
Returns
PointBetween(Double)
Declaration
public Vector2d PointBetween(double t)
Parameters
Type |
Name |
Description |
Double |
t |
|
Returns
Project(Vector2d)
Declaration
public double Project(Vector2d p)
Parameters
Returns
Reverse()
Declaration
SampleArcLength(Double)
Declaration
public Vector2d SampleArcLength(double a)
Parameters
Type |
Name |
Description |
Double |
a |
|
Returns
SampleT(Double)
Declaration
public Vector2d SampleT(double t)
Parameters
Type |
Name |
Description |
Double |
t |
|
Returns
TangentT(Double)
Declaration
public Vector2d TangentT(double t)
Parameters
Type |
Name |
Description |
Double |
t |
|
Returns
Declaration
public void Transform(ITransform2 xform)
Parameters
WhichSide(Vector2d, Double)
Returns:
+1, on right of line
-1, on left of line
0, on the line
Declaration
public int WhichSide(Vector2d test, double tol = 0)
Parameters
Returns
WhichSide(ref Vector2d, ref Vector2d, ref Vector2d, Double)
Returns:
+1, on right of line
-1, on left of line
0, on the line
Declaration
public static int WhichSide(ref Vector2d a, ref Vector2d b, ref Vector2d test, double tol = 0)
Parameters
Returns
Implements