Skip to content

The CGALGlobal Functions

Justin edited this page Feb 24, 2022 · 3 revisions

This page refers to the functions found in the CGALGlobal static class found in the CGALDotNet namespace.

The CGALGlobal static class contains a number of utility functions that maybe helpful. You can find the CGAL version and Eigen version numbers here like so.

//Print the CGAL version.
Console.WriteLine("The CGAL Version in use is " + CGALGlobal.Version);

//Print the Eigen version.
Console.WriteLine("The Eigen Version in use is " + CGALGlobal.EigenVersion);

Below is a example of some of the utility functions that can be found here.

/// <summary>
/// Returns OBTUSE, RIGHT or ACUTE depending on the 
/// angle formed by the two vectors u and v.
/// </summary>
/// <returns>OBTUSE, RIGHT or ACUTE depending on the 
/// angle formed by the two vectors u and v.</returns>
public static ANGLE Angle(Vector2d u, Vector2d v);

/// <summary>
/// Returns true if p, q, and r form a left turn.
/// </summary>
/// <returns>Returns true if p, q, and r form a left turn.</returns>
public static bool LeftTurn(Point2d p, Point2d q, Point2d r);

/// <summary>
/// Returns LEFT_TURN, if r lies to the left of the oriented 
/// line l defined by p and q, returns RIGHT_TURN if r lies 
/// to the right of l, and returns COLLINEAR if r lies on l.
/// </summary>
public static ORIENTATION Orientation(Point2d p, Point2d q, Point2d r);

These function can make up predicates that can aid in further geometrical operations.

Clone this wiki locally