[This is preliminary documentation and is subject to change.]

The absolute value of the returned value is two times the area of the triangle ABC. (Integer version.)

Namespace: org.critterai.geom
Assembly: cai-util (in cai-util.dll) Version: 0.5.0.0 (0.5.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public static int GetSignedAreaX2(
	int ax,
	int ay,
	int bx,
	int by,
	int cx,
	int cy
)
Public Shared Function GetSignedAreaX2 ( _
	ax As Integer, _
	ay As Integer, _
	bx As Integer, _
	by As Integer, _
	cx As Integer, _
	cy As Integer _
) As Integer
public:
static int GetSignedAreaX2(
	int ax, 
	int ay, 
	int bx, 
	int by, 
	int cx, 
	int cy
)

Parameters

ax
Int32
The x-value for vertex A of triangle ABC
ay
Int32
The y-value for vertex A of triangle ABC
bx
Int32
The x-value for vertex B of triangle ABC
by
Int32
The y-value for vertex B of triangle ABC
cx
Int32
The x-value for vertex C of triangle ABC
cy
Int32
The y-value for vertex C of triangle ABC

Return Value

The absolute value of the returned value is two times the area of the triangle ABC.

Remarks

A positive return value indicates:

  • Counterclockwise wrapping of the vertices.
  • Vertex B lies to the right of line AC, looking from A toward C.

A negative value indicates:

  • Clockwise wrapping of the vertices.
  • Vertex B lies to the left of line AC, looking from A toward C.

A value of zero indicates that all points are collinear orrepresent the same point.

This is a low cost method.

See Also