Struct Triangle2d
Struct to handle a 2D triangle
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct Triangle2d
Constructors
View SourceTriangle2d(Point2d, Point2d, Point2d)
Create a 2D triangle from 3 coordinates in the form of Point2d
Declaration
public Triangle2d(Point2d point1, Point2d point2, Point2d point3)
Parameters
Type | Name | Description |
---|---|---|
Point2d | point1 | Value of the first point of the triangle |
Point2d | point2 | Value of the second point of the triangle |
Point2d | point3 | Value of the third point of the triangle |
Triangle2d(Point3d, Point3d, Point3d)
Create a 2D triangle from 3 coordinates in the form of Point3d
Declaration
public Triangle2d(Point3d point1, Point3d point2, Point3d point3)
Parameters
Type | Name | Description |
---|---|---|
Point3d | point1 | Value of the first point of the triangle |
Point3d | point2 | Value of the second point of the triangle |
Point3d | point3 | Value of the third point of the triangle |
Properties
View SourcePoint1
Property to access the first point of the triangle
Declaration
public Point2d Point1 { get; set; }
Property Value
Type | Description |
---|---|
Point2d | FPAssistant Point2d |
Point2
Property to access the second point of the triangle
Declaration
public Point2d Point2 { get; set; }
Property Value
Type | Description |
---|---|
Point2d | FPAssistant Point2d |
Point3
Property to access the third point of the triangle
Declaration
public Point2d Point3 { get; set; }
Property Value
Type | Description |
---|---|
Point2d | FPAssistant Point2d |
Methods
View SourceArea()
Calculate area of triangle formed by (x1, y1) (x2, y2) and(x3, y3)
Declaration
public double Area()
Returns
Type | Description |
---|---|
System.Double |
IsInside(Point2d)
Check whether point P(x, y) lies inside the triangle formed by A(x1, y1), B(x2, y2) and C(x3, y3)
Declaration
public bool IsInside(Point2d point)
Parameters
Type | Name | Description |
---|---|---|
Point2d | point | Point defined as a Point2d |
Returns
Type | Description |
---|---|
System.Boolean | True of false depending if point lies inside the triangle |
IsInside(Point3d)
Check whether point P(x, y) lies inside the triangle formed by A(x1, y1), B(x2, y2) and C(x3, y3)
Declaration
public bool IsInside(Point3d point)
Parameters
Type | Name | Description |
---|---|---|
Point3d | point | Point defined as a Point3d where the z component is ignored |
Returns
Type | Description |
---|---|
System.Boolean | True of false depending if point lies inside the triangle |