Foundation (CVFoundation.dll) 14.0
Math Helper Functions

Functions

cvbres_t AddAngles (ANGLE Angle1, ANGLE Angle2, ANGLE &Sum)
 Adds two angle objects. More...
 
cvbres_t AddVector2DToPixelList (VECTOR2D Vector, PIXELLIST List)
 Inserts a Vector2D object into a pixel list. More...
 
cvbres_t AddVectors2D (VECTOR2D Vector1, VECTOR2D Vector2, VECTOR2D &Result)
 Build the sum of two vectors. More...
 
cvbres_t CalculateCircleRegression (PIXELLIST pl, double &centerX, double &centerY, double &radius)
 Calculate a circle from a pixel list. More...
 
cvbres_t CalculateEllipseRegression (PIXELLIST pl, double &centerX, double &centerY, double &radiusA, double &radiusB, double &rotation)
 Calculate an ellipse from a pixel list. More...
 
cvbres_t CompareAngles (ANGLE Angle1, ANGLE Angle2, long &Result)
 Compares two angles. More...
 
ANGLE CreateAngle ()
 Create an angle object initialized to zero degrees. More...
 
ANGLE CreateAngleArgument (double X, double Y)
 Create an angle object and initialize it with angle between the x-axis and the point whose coordinates are given. More...
 
ANGLE CreateAngleDegrees (double Deg)
 Create an angle object and initialize it with an angle given in degrees. More...
 
ANGLE CreateAngleRadians (double Rad)
 Create an angle object and initialize it with an angle given in radians. More...
 
CIRCLE2D CreateCircle2D ()
 Create an uninitialized circle object (center at (0,0), radius 0). More...
 
CIRCLE2D CreateCircle2DByRegression (PIXELLIST RegressionList)
 Create a circle object based on a regression based on the points given in the input pixel-list. More...
 
CIRCLE2D CreateCircle2DParametric (double CenterX, double CenterY, double Radius)
 Create a circle object by defining its center point and radius. More...
 
LINE2D CreateLine2DAnalytical (double A, double B, cvbbool_t AxplusB)
 Create a line object according to its analytical formula. More...
 
LINE2D CreateLine2DByRegression (PIXELLIST RegressionList)
 Create a line object by performing a linear regression over an input pixel-list. More...
 
LINE2D CreateLine2DDistanceOrientation (double Distance, ANGLE Direction)
 Create a line object by specifying its distance from the origin and the direction in which the line is running. More...
 
LINE2D CreateLine2DNormalDistance (VECTOR2D Normal, double Distance)
 Create a line object by specifying its distance from the origin and a normal vector on the line. More...
 
LINE2D CreateLine2DTwoPoints (VECTOR2D Point1, VECTOR2D Point2)
 Create a line object by defining two points that are lying on the line. More...
 
LINE2D CreateLine2DVectorOrientation (VECTOR2D Vector, ANGLE Direction)
 Create a line object by defining a point on the line and the angle at which the line passes through that point. More...
 
cvbres_t CreateNormalizedVector2D (VECTOR2D Input, VECTOR2D &Output)
 Create a normalized version of the input vector. More...
 
cvbres_t CreateNormalVector2D (VECTOR2D Input, VECTOR2D &Output)
 Create a normal vector of the input vector. More...
 
LINE2D CreatePerpendicularLine2D (LINE2D Line, VECTOR2D Point)
 Create a line object that is perpendicular to the input line and runs through a given point. More...
 
VECTOR2D CreateVector2D ()
 Create a null vector object. More...
 
VECTOR2D CreateVector2DCartesian (double X, double Y)
 Create a vector object and initializes it with the specified cartesian data. More...
 
VECTOR2D CreateVector2DFromPOINT (POINT Vertex)
 Create a vector object and initializes it with the values taken from the specified POINT structure. More...
 
VECTOR2D CreateVector2DRadial (ANGLE Ang, double Radius)
 Create a vector object and initialize it with values given in radial coordinates. More...
 
cvbres_t DoLine2DClip (LINE2D Line, TDRect ClippingRect, VECTOR2D &Clip1, VECTOR2D &Clip2)
 Calculates the two points at which a line object (potentially) intersects with a TDRect structure. More...
 
cvbres_t GetAngleCosine (ANGLE Angle, double &Cosine)
 Get the cosine of an angle object. More...
 
cvbres_t GetAngleDegrees (ANGLE Angle, double &Degrees)
 Get an angle object's value in degrees. More...
 
cvbres_t GetAngleRadians (ANGLE Angle, double &Radians)
 Get an angle object's value in radians. More...
 
cvbres_t GetAngleSine (ANGLE Angle, double &Sine)
 Get the sine of an angle object. More...
 
cvbres_t GetAngleTangent (ANGLE Angle, double &Tangent)
 Get the tangent of an angle object. More...
 
cvbres_t GetCircle2DCenter (CIRCLE2D Circle, double &CenterX, double &CenterY)
 Retrieve the center of a circle object. More...
 
cvbres_t GetCircle2DRadius (CIRCLE2D Circle, double &Radius)
 Retrieve the radius of a circle object. More...
 
cvbres_t GetCircle2DRoundness (CIRCLE2D Circle, PIXELLIST PointList, double &Roundness)
 Get measure for the quality of a fitted circle. More...
 
cvbres_t GetLine2DAXBFormula (LINE2D Line, double &A, double &B)
 Get the analytical formula in the shape y = A * x + B that describes a line object. More...
 
cvbres_t GetLine2DAYBFormula (LINE2D Line, double &A, double &B)
 Get the analytical formula in the shape x = A * y + B that describes a line object. More...
 
cvbres_t GetLine2DInclination (LINE2D Line, ANGLE &Inclination)
 Retrieves the inclination of a line object (the angle at which it intersects the x-axis of the coordinate system). More...
 
cvbres_t GetLine2DIntersectionAngle (LINE2D Line1, LINE2D Line2, ANGLE &Intersection)
 Calculate the angle at which two lines intersect. More...
 
cvbres_t GetLine2DIntersectionPoint (LINE2D Line1, LINE2D Line2, VECTOR2D &Result)
 Get the point at which two lines intersect. More...
 
cvbres_t GetLine2DNormalVector (LINE2D Line, VECTOR2D &Vector)
 Calculate normal vector of a line object. More...
 
cvbres_t GetLine2DOriginDistance (LINE2D Line, double &Distance)
 Get the distance of a line object from the origin. More...
 
cvbres_t GetLine2DVectorOrientation (LINE2D Line, VECTOR2D &Vector, ANGLE &Angle)
 Get a point on a line object and the angle at which the line crosses that point. More...
 
cvbres_t GetManyLine2DIntersectionPoint (LINE2D *LineArray, size_t ArrayLength, double ConvergenceThreshold, cvbval_t MaxIterations, VECTOR2D &Point)
 Uses an iteration scheme to approximate the intersection point of an array of line objects. More...
 
cvbres_t GetPointDistance2D (VECTOR2D Point1, VECTOR2D Point2, double &Distance)
 Calculate the distance between two points pointed to by two vectors. More...
 
cvbres_t GetPointLine2DDistance (LINE2D Line, VECTOR2D Point, double &Distance)
 Get the distance between a line and a point. More...
 
cvbres_t GetVector2DCartesian (VECTOR2D Input, double &X, double &Y)
 Get the Cartesian components of a 2D vector object. More...
 
cvbres_t GetVector2DLength (VECTOR2D Input, double &Length)
 Get the length of a vector object. More...
 
cvbres_t GetVector2DRadial (VECTOR2D Input, ANGLE &Angle, double &Radius)
 Get the radial coordinates of a 2D vector object. More...
 
cvbres_t InnerProduct2D (VECTOR2D Vector1, VECTOR2D Vector2, double &Result)
 Calculates the inner product of two vectors. More...
 
BOOL IsAngle (ANGLE Handle)
 Checks whether a handle points to an angle object or not. More...
 
cvbres_t IsAntiParallelVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result)
 Checks whether two vectors are anti parallel (i.e. parallel but pointing into different directions). More...
 
BOOL IsCircle2D (CIRCLE2D Handle)
 Checks whether a handle points to a circle object or not. More...
 
cvbres_t IsEqualCircle2D (CIRCLE2D Circle1, CIRCLE2D Circle2, cvbbool_t &Result)
 Checks whether two circles are equal. More...
 
cvbres_t IsEqualLine2D (LINE2D Line1, LINE2D Line2, cvbbool_t &Result)
 Checks two line objects for equality. More...
 
cvbres_t IsEqualVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result)
 Checks two vector objects for equality. More...
 
BOOL IsLine2D (LINE2D Handle)
 Checks whether a handle points to an line object or not. More...
 
cvbres_t IsLine2DParallel (LINE2D Line1, LINE2D Line2, cvbbool_t &Result)
 Checks whether two line objects are parallel. More...
 
cvbres_t IsLine2DPerpendicular (LINE2D Line1, LINE2D Line2, cvbbool_t &Result)
 Checks whether two line objects are perpendicular. More...
 
cvbres_t IsParallelVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result)
 Checks whether two vector objects are parallel. More...
 
cvbres_t IsPerpendicularVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result)
 Checks whether two vector objects are perpendicular. More...
 
cvbres_t IsPointInCircle2D (CIRCLE2D Circle, double PointX, double PointY, cvbbool_t &Result)
 Checks whether a given point is inside a circle. More...
 
cvbres_t IsPointOnCircle2DRadius (CIRCLE2D Circle, double PointX, double PointY, double Epsilon, cvbbool_t &Result)
 Checks whether a point is on the radius (or within a small epsilon environment of the radius) of a circle object. More...
 
BOOL IsVector2D (LINE2D Handle)
 Checks whether a handle points to a VECTOR2D object or not. More...
 
cvbres_t MultiplyAngle (ANGLE Angle, double Constant)
 Multiply an angle with a (dimension-free) number. More...
 
cvbres_t MultiplyVector2D (VECTOR2D Vector, double Scalar, VECTOR2D &Result)
 Multiply a vector with a scalar. More...
 
cvbres_t SetAngleArgument (ANGLE Angle, double X, double Y)
 Set an angle to a new value which is defined as the angle between the x-axis and the line connecting the origin to a point (X,Y). More...
 
cvbres_t SetAngleDegrees (ANGLE Angle, double Degrees)
 Set an angle object to a new value. More...
 
void SetAngleLUTGranularityDeg (double Granularity)
 Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations. More...
 
void SetAngleLUTGranularityRad (double Granularity)
 Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations. More...
 
cvbres_t SetAngleRadians (ANGLE Angle, double Radians)
 Set an angle object to a new value. More...
 
cvbres_t SetLine2DAnalytical (LINE2D Line, double A, double B, cvbbool_t AxplusB)
 Change a line object according to its analytical formula. More...
 
cvbres_t SetLine2DByRegression (LINE2D Line, PIXELLIST RegressionList)
 Modifies a 2D line object by performing a linear regression over an input pixel list. More...
 
cvbres_t SetLine2DDistanceOrientation (LINE2D Line, double Distance, ANGLE Direction)
 Modifies a line 2D object by specifying its distance from the origin and the direction in which the line is running (direction of the tangent on the circle around the origin with radius r). More...
 
cvbres_t SetLine2DInclination (LINE2D Line, ANGLE Inclination)
 Change the inclination of a line object. More...
 
cvbres_t SetLine2DNormalVector (LINE2D Line, VECTOR2D Normal)
 Redefine a line by changing its normal vector. More...
 
cvbres_t SetLine2DOriginDistance (LINE2D Line, double Distance)
 Change the distance of a line from the origin. More...
 
cvbres_t SetLine2DTwoPoints (LINE2D Line, VECTOR2D Point1, VECTOR2D Point2)
 Change a line object by specifying two points the line should cross. More...
 
cvbres_t SetVector2DCartesian (VECTOR2D Input, double X, double Y)
 Set the Cartesian components of a 2D vector object. More...
 
cvbres_t SetVector2DRadial (VECTOR2D Input, ANGLE Angle, double Radius)
 Set a 2D vector object to new radial coordinates. More...
 
cvbres_t SubtractAngles (ANGLE Angle1, ANGLE Angle2, ANGLE &Diff)
 Subtracts two angle objects. More...
 
cvbres_t SubtractVectors2D (VECTOR2D Vector1, VECTOR2D Vector2, VECTOR2D &Result)
 Build the difference of two vectors. More...
 

Detailed Description

Function Documentation

◆ AddAngles()

cvbres_t AddAngles ( ANGLE  Angle1,
ANGLE  Angle2,
ANGLE Sum 
)

Adds two angle objects.

Automatically takes care of the fact that the angles wrap around at -Pi and +Pi.
Parameters
[in]Angle1First angle to be added.
[in]Angle2Second angle to be added.
[out]SumHandle of result angle containing the sum (Angle1 + Angle2).
Attention: Handle must be released with the ReleaseObject when no longer needed.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ AddVector2DToPixelList()

cvbres_t AddVector2DToPixelList ( VECTOR2D  Vector,
PIXELLIST  List 
)

Inserts a Vector2D object into a pixel list.

Attention
The pixel that is added to the list will have the Cartesian coordinates of the vector. Any additional elements of the pixel for pixel list dimensions beyond 2 will be set to zero.
Parameters
[in]VectorVector to be added to the pixel list.
[in,out]ListList to add the pixel to.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
Datatype Pixellist - see Image library

◆ AddVectors2D()

cvbres_t AddVectors2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
VECTOR2D Result 
)

Build the sum of two vectors.

Parameters
[in]Vector1First vector to be added.
[in]Vector2Second vector to be added.
[out]ResultHandle of result vector containing the sum (Vector1 + Vector2).
Attention: Handle must be released with the ReleaseObject when no longer needed.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CalculateCircleRegression()

cvbres_t CalculateCircleRegression ( PIXELLIST  pl,
double &  centerX,
double &  centerY,
double &  radius 
)

Calculate a circle from a pixel list.

This function assumes that all the pixels in the provided pixel list are located on the perimeter of a circle and calculates the center coordinates and the radius of that circle using a linear regression approach.

The regression works best if the pixels are evenly distributed over the whole perimeter of the circle. Taking pixels from only a small segment of the circle works, but the smaller that segment gets, the higher the error from the calculation will become.

At least three pixels are required to carry out the calculation and get an unambiguous result - if pl contains less than three pixels an error CVC_E_NOTENOUGHDATA will be returned. The processing time required for the regression increases with the 3rd power of the pixel count, i.e. if 6 pixels are given, the calculations will take 8 times as long as they would take with only 3 pixels.

Parameters
[in]plPixel list.
[out]centerXCenter of the circle (x coordinate in the same units the pixel list is using).
[out]centerYCenter of the circle (y coordinate in the same units the pixel list is using).
[out]radiusRadius of the circle (in the same units the pixel list is using).
Returns
One of the CVC_ERROR values. < 0 indicates an error.

◆ CalculateEllipseRegression()

cvbres_t CalculateEllipseRegression ( PIXELLIST  pl,
double &  centerX,
double &  centerY,
double &  radiusA,
double &  radiusB,
double &  rotation 
)

Calculate an ellipse from a pixel list.

This function assumes that all the pixels in the provided pixel list are located on the perimeter of an ellipse and calculates the center coordinates, the two semi major axises and the rotation angle of that ellipse using a linear regression approach.

The regression works best if the pixels are evenly distributed over the whole perimeter of the ellipse. Taking pixels from only a small segment of the ellipse works, but the smaller that segment gets, the higher the error from the calculation will become.

At least six pixels are required to carry out the calculation and get an unambiguous result - if pl contains less than six pixels an error CVC_E_NOTENOUGHDATA will be returned.

Note
Calculating ellipse parameters is a lot more time-consuming than what e.g. CalculateCircleRegression does.
Parameters
[in]plPixel list.
[out]centerXCenter of the ellipse (x coordinate in the same units the pixel list is using).
[out]centerYCenter of the ellipse (y coordinate in the same units the pixel list is using).
[out]radiusASemi major radius of the ellipse (in the same units the pixel list is using).
[out]radiusBSemi major radius of the ellipse (in the same units the pixel list is using).
[out]rotationRotation angle of the ellipse (in degrees).
Returns
One of the CVC_ERROR values. < 0 indicates an error.

◆ CompareAngles()

cvbres_t CompareAngles ( ANGLE  Angle1,
ANGLE  Angle2,
long &  Result 
)

Compares two angles.

For the comparison keep in mind, that angles wrap around at -Pi and + Pi (-180 degrees and +180 degrees) which means that there will
never be an angle of e.g. 181 and an angle created with 181 degrees will actually be smaller than one
created with 179 degrees because 181 degrees internally becomes -179 degrees.
Parameters
[in]Angle1First angle for comparison.
[in]Angle2Second angle for comparison.
[out]ResultResult of the comparison:
0 if Angle 1 = Angle 2
1 if Angle 1 > Angle 2
-1 if Angle 1 < Angle 2
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateAngle()

ANGLE CreateAngle ( )

Create an angle object initialized to zero degrees.

Attention
The angle object must be released using ReleaseObject once it is no longer used.
Returns
Handle to the newly created angle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateAngleArgument()

ANGLE CreateAngleArgument ( double  X,
double  Y 
)

Create an angle object and initialize it with angle between the x-axis and the point whose coordinates are given.

Attention
X = Y = 0 is invalid input and will not result in an angle object to be created (return value NULL). The angle object must be released using ReleaseObject once it is no longer used.
Parameters
[in]XX-coordinate of the point.
[in]YY-coordinate of the point.
Returns
Handle to the newly created angle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateAngleDegrees()

ANGLE CreateAngleDegrees ( double  Deg)

Create an angle object and initialize it with an angle given in degrees.

Attention
The input angle will internally be cut down to a range of [-180...180[. The angle object must be released using ReleaseObject once it is no longer used.
Parameters
[in]DegInitialization value in degrees.
Returns
Handle to the newly created angle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateAngleRadians()

ANGLE CreateAngleRadians ( double  Rad)

Create an angle object and initialize it with an angle given in radians.

Attention
The input angle will internally be cut down to a range of [-Pi...Pi[. The angle object must be released using ReleaseObject once it is no longer used.
Parameters
[in]RadInitialization value in radians.
Returns
Handle to the newly created angle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateCircle2D()

CIRCLE2D CreateCircle2D ( )

Create an uninitialized circle object (center at (0,0), radius 0).

Attention
The circle object must be released using ReleaseObject once it is no longer used.
Returns
Handle to the newly created circle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateCircle2DByRegression()

CIRCLE2D CreateCircle2DByRegression ( PIXELLIST  RegressionList)

Create a circle object based on a regression based on the points given in the input pixel-list.

The regression assumes that all the points in the input pixel list are lying on the \b perimeter of a circle. \n\n
The algorithm then performs a linear regression to find out the <b>center point</b> and \b radius of the circle,
minimizing the error of both parameters on the input pixel list. \n\n
Regression requires at least two pixels in the input pixel list (in which case the output circle will be an exact result).
For 3 input pixels, the result will be exact as well, any additional pixels may introduce a statistical error.
Regression is based on a QR split, therefore processing time increases with n<sup>3</sup>.
Attention
The circle object must be released using ReleaseObject once it is no longer used.
Parameters
[in]RegressionListPixel list containing the pixels that define the circle object.
Returns
Handle to the newly created circle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
Datatype Pixellist - see Image library
ReleaseObject function - see Image library

◆ CreateCircle2DParametric()

CIRCLE2D CreateCircle2DParametric ( double  CenterX,
double  CenterY,
double  Radius 
)

Create a circle object by defining its center point and radius.

Attention
The circle object must be released using ReleaseObject once it is no longer used.
Parameters
[in]CenterXX-coordinate of the circle's center.
[in]CenterYY-coordinate of the circle's center.
[in]RadiusRadius of the circle.
Returns
Handle to the newly created circle object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateLine2DAnalytical()

LINE2D CreateLine2DAnalytical ( double  A,
double  B,
cvbbool_t  AxplusB 
)

Create a line object according to its analytical formula.

Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]ASteepness parameter of the line.
[in]BOffset parameter of the line.
[in]AxplusBSpecifies the formula to be used to define the line. TRUE: y = A * x + B (cannot define a vertical line) FALSE: x = A * y + B (cannot define a horizontal line)
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateLine2DByRegression()

LINE2D CreateLine2DByRegression ( PIXELLIST  RegressionList)

Create a line object by performing a linear regression over an input pixel-list.

Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]RegressionListList of pixels that define the line.
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
CreateCircle2DByRegression
Datatype Pixellist - see Image library

◆ CreateLine2DDistanceOrientation()

LINE2D CreateLine2DDistanceOrientation ( double  Distance,
ANGLE  Direction 
)

Create a line object by specifying its distance from the origin and the direction in which the line is running.

The direction of the line is the direction of the tangent on the circle around the origin with radius r.
Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]DistanceLine's distance from the origin.
[in]DirectionDirection of the line.
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateLine2DNormalDistance()

LINE2D CreateLine2DNormalDistance ( VECTOR2D  Normal,
double  Distance 
)

Create a line object by specifying its distance from the origin and a normal vector on the line.

Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]NormalVector that is perpendicular on the line.
[in]DistanceLine's distance from the origin.
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateLine2DTwoPoints()

LINE2D CreateLine2DTwoPoints ( VECTOR2D  Point1,
VECTOR2D  Point2 
)

Create a line object by defining two points that are lying on the line.

Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]Point1First point on the line.
[in]Point2Second point on the line.
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
CreateVector2DFromPOINT

◆ CreateLine2DVectorOrientation()

LINE2D CreateLine2DVectorOrientation ( VECTOR2D  Vector,
ANGLE  Direction 
)

Create a line object by defining a point on the line and the angle at which the line passes through that point.

Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]VectorPoint on the line
[in]DirectionDirection of the line passing through the point.
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateNormalizedVector2D()

cvbres_t CreateNormalizedVector2D ( VECTOR2D  Input,
VECTOR2D Output 
)

Create a normalized version of the input vector.

The normalized vector has the same orientation as the input vector, but with length 1.
Parameters
[in]InputHandle of input vector.
[out]OutputHandle of normalized output vector.
Attention: The vector object must be released using ReleaseObject once it is no longer used.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateNormalVector2D()

cvbres_t CreateNormalVector2D ( VECTOR2D  Input,
VECTOR2D Output 
)

Create a normal vector of the input vector.

The output vector has the same length as the input vector, but is perpendicular on the input vector.
Parameters
[in]InputHandle of input vector.
[out]OutputHandle of normal vector.
Attention: The vector object must be released using ReleaseObject once it is no longer used.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreatePerpendicularLine2D()

LINE2D CreatePerpendicularLine2D ( LINE2D  Line,
VECTOR2D  Point 
)

Create a line object that is perpendicular to the input line and runs through a given point.

Attention
The line object must be released using ReleaseObject once it is no longer used.
Parameters
[in]LineHandle of input line object.
[in]PointPoint through which the new line should run.
Returns
Handle to the newly created line object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateVector2D()

VECTOR2D CreateVector2D ( )

Create a null vector object.

Attention
The vector object must be released using ReleaseObject once it is no longer used.
Returns
Handle to the newly created vector object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateVector2DCartesian()

VECTOR2D CreateVector2DCartesian ( double  X,
double  Y 
)

Create a vector object and initializes it with the specified cartesian data.

Attention
The vector object must be released using ReleaseObject once it is no longer used.
Parameters
[in]XX-component of the vector.
[in]YY-component of the vector.
Returns
Handle to the newly created vector object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ CreateVector2DFromPOINT()

VECTOR2D CreateVector2DFromPOINT ( POINT  Vertex)

Create a vector object and initializes it with the values taken from the specified POINT structure.

Attention
The vector object must be released using ReleaseObject once it is no longer used.
Parameters
[in]VertexPoint with which to initialize the vector.
Returns
Handle to the newly created vector object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
GetPointDistance2D

◆ CreateVector2DRadial()

VECTOR2D CreateVector2DRadial ( ANGLE  Ang,
double  Radius 
)

Create a vector object and initialize it with values given in radial coordinates.

Attention
The vector object must be released using ReleaseObject once it is no longer used.
Parameters
[in]AngAngle coordinate of the vector.
[in]RadiusRadius coordinate of the vector.
Returns
Handle to the newly created vector object or NULL if creation failed.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ DoLine2DClip()

cvbres_t DoLine2DClip ( LINE2D  Line,
TDRect  ClippingRect,
VECTOR2D Clip1,
VECTOR2D Clip2 
)

Calculates the two points at which a line object (potentially) intersects with a TDRect structure.

Parameters
[in]LineHandle of line object to calculate the intersection for.
[in]ClippingRectRectangle with which to intersect the line.
[out]Clip1Handle to a newly created vector object containing the first intersection point.
Attention: The vector object must be released using ReleaseObject once it is no longer used.
[out]Clip2Handle to a newly created vector object containing the second intersection point.
Attention: The vector object must be released using ReleaseObject once it is no longer used.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetAngleCosine()

cvbres_t GetAngleCosine ( ANGLE  Angle,
double &  Cosine 
)

Get the cosine of an angle object.

This function either calculates the cosine using the standard implementation of that function,
or it approximates the value by transparently using a lookup table that has been previously generated
with \ref SetAngleLUTGranularityDeg or \ref SetAngleLUTGranularityRad.
Parameters
[in]AngleHandle of angle object.
[out]CosineCosine of the angle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
SetAngleLUTGranularityDeg, SetAngleLUTGranularityRad

◆ GetAngleDegrees()

cvbres_t GetAngleDegrees ( ANGLE  Angle,
double &  Degrees 
)

Get an angle object's value in degrees.

Parameters
[in]AngleHandle of angle object.
[out]DegreesCurrent value of the angle in degrees in the range [-180...180[.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetAngleRadians()

cvbres_t GetAngleRadians ( ANGLE  Angle,
double &  Radians 
)

Get an angle object's value in radians.

Parameters
[in]AngleHandle of angle object.
[out]RadiansCurrent value of the angle in radians in the range [-Pi...Pi[.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetAngleSine()

cvbres_t GetAngleSine ( ANGLE  Angle,
double &  Sine 
)

Get the sine of an angle object.

This function either calculates the sine using the standard implementation of that function,
or it approximates the value by transparently using a lookup table that has been previously generated
with \ref SetAngleLUTGranularityDeg or \ref SetAngleLUTGranularityRad.
Parameters
[in]AngleHandle of angle object.
[out]SineSine of the angle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
SetAngleLUTGranularityDeg, SetAngleLUTGranularityRad

◆ GetAngleTangent()

cvbres_t GetAngleTangent ( ANGLE  Angle,
double &  Tangent 
)

Get the tangent of an angle object.

This function either calculates the sine using the standard implementation of that function,
or it approximates the value by transparently using a lookup table that has been previously generated
with \ref SetAngleLUTGranularityDeg or \ref SetAngleLUTGranularityRad.
Parameters
[in]AngleHandle of angle object.
[out]TangentTangent of the angle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
SetAngleLUTGranularityDeg, SetAngleLUTGranularityRad

◆ GetCircle2DCenter()

cvbres_t GetCircle2DCenter ( CIRCLE2D  Circle,
double &  CenterX,
double &  CenterY 
)

Retrieve the center of a circle object.

Parameters
[in]CircleHandle of circle object.
[out]CenterXX-coordinate of the circle's center.
[out]CenterYY-coordinate of the circle's center.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetCircle2DRadius()

cvbres_t GetCircle2DRadius ( CIRCLE2D  Circle,
double &  Radius 
)

Retrieve the radius of a circle object.

Parameters
[in]CircleHandle of circle object.
[out]RadiusRadius of circle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetCircle2DRoundness()

cvbres_t GetCircle2DRoundness ( CIRCLE2D  Circle,
PIXELLIST  PointList,
double &  Roundness 
)

Get measure for the quality of a fitted circle.

Parameters
[in]CircleCircle2D Circle fitted into the point list (e.g. by regression).
[in]PointListPIXELLIST Measured points, the circle is created from
[out]Roundnessdouble& The roundness is defined as the mean percentage deviation between a measured point and its equivalent on the circumference
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
PIXELLIST, CIRCLE2D

◆ GetLine2DAXBFormula()

cvbres_t GetLine2DAXBFormula ( LINE2D  Line,
double &  A,
double &  B 
)

Get the analytical formula in the shape y = A * x + B that describes a line object.

Attention
Vertical lines may not be described with that formula, and passing a vertical line to this function will result in an error.
Parameters
[in]LineHandle of line object.
[out]ASlope parameter of the formula.
[out]BOffset parameter of the formula.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetLine2DAYBFormula()

cvbres_t GetLine2DAYBFormula ( LINE2D  Line,
double &  A,
double &  B 
)

Get the analytical formula in the shape x = A * y + B that describes a line object.

Attention
Horizontal lines may not be described with that formula, and passing a horizontal line to this function will result in an error.
Parameters
[in]LineHandle of line object.
[out]ASlope parameter of the formula.
[out]BOffset parameter of the formula.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetLine2DInclination()

cvbres_t GetLine2DInclination ( LINE2D  Line,
ANGLE Inclination 
)

Retrieves the inclination of a line object (the angle at which it intersects the x-axis of the coordinate system).

Parameters
[in]LineHandle of line object to retrieve the inclination for.
[out]InclinationInclination of the line.
Attention: The angle object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used!
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetLine2DIntersectionAngle()

cvbres_t GetLine2DIntersectionAngle ( LINE2D  Line1,
LINE2D  Line2,
ANGLE Intersection 
)

Calculate the angle at which two lines intersect.

Parameters
[in]Line1Handle of first line object for the intersection.
[in]Line2Handle of second line object for the intersection.
[out]IntersectionIntersection angle of the two lines or NULL if they do not intersect.
Attention: The angle object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used!
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetLine2DIntersectionPoint()

cvbres_t GetLine2DIntersectionPoint ( LINE2D  Line1,
LINE2D  Line2,
VECTOR2D Result 
)

Get the point at which two lines intersect.

Parameters
[in]Line1Handle of first line object for the intersection.
[in]Line2Handle of second line object for the intersection.
[out]ResultIntersection point of the two lines or NULL if they do not intersect.
Attention: The vector object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used!
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
CreateLine2DAnalytical, CreateLine2DByRegression, CreateLine2DDistanceOrientation, CreateLine2DNormalDistance, CreateLine2DTwoPoints, CreateLine2DVectorOrientation

◆ GetLine2DNormalVector()

cvbres_t GetLine2DNormalVector ( LINE2D  Line,
VECTOR2D Vector 
)

Calculate normal vector of a line object.

Parameters
[in]LineHandle of line object for which to calculate the normal vector.
[out]VectorNormal vector on the line.
Attention: The vector object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used!
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetLine2DOriginDistance()

cvbres_t GetLine2DOriginDistance ( LINE2D  Line,
double &  Distance 
)

Get the distance of a line object from the origin.

Parameters
[in]LineHandle of line object for which to retrieve the distance.
[out]DistanceDistance of the line object from the origin.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetLine2DVectorOrientation()

cvbres_t GetLine2DVectorOrientation ( LINE2D  Line,
VECTOR2D Vector,
ANGLE Angle 
)

Get a point on a line object and the angle at which the line crosses that point.

Parameters
[in]LineHandle of line object.
[out]VectorVector pointing from the origin to a point on the line.
Attention: The vector object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used!
[out]AngleAngle at which the line crosses the point pointed to by Vector.
Attention: The angle object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used!
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetManyLine2DIntersectionPoint()

cvbres_t GetManyLine2DIntersectionPoint ( LINE2D LineArray,
size_t  ArrayLength,
double  ConvergenceThreshold,
cvbval_t  MaxIterations,
VECTOR2D Point 
)

Uses an iteration scheme to approximate the intersection point of an array of line objects.

Parameters
[in]LineArrayArray of handles to line objects for which to calculate the intersection approximation.
[in]ArrayLengthLength of the line array.
[in]ConvergenceThresholdThreshold for the convergence.
If during the iteration process the difference between two steps is below this threshold, the iteration stops. Therefore this threshold is also the upper limit of the error if the iteration succeeds.
[in]MaxIterationsNumber of iterations after which to stop the iteration process. Specifying -1 will run indefinitely.
[out]PointIntersection point.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetPointDistance2D()

cvbres_t GetPointDistance2D ( VECTOR2D  Point1,
VECTOR2D  Point2,
double &  Distance 
)

Calculate the distance between two points pointed to by two vectors.

Parameters
[in]Point1Vector pointing to first point.
[in]Point2Vector pointing to second point.
[out]DistanceDistance between those points.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
VB Sample Code:
Dim lX0, lY0, lX1, lY1,lPoint0, lPoint1 As Long
Dim dDistance
lX0 = 10 'P0 with (x/y)'
lY0 = 10
lX1 = 20 'P1 with (x/y)'
lY1 = lX0
Point0 = CreateVector2DFromPOINT(lX0, lY0) 'PO'
lPoint1 = CreateVector2DFromPOINT(lX1, lY1) 'P1'
GetPointDistance2D lPoint0, lPoint1, dDistance 'calculate distance from 2 points'
cvbres_t GetPointDistance2D(VECTOR2D Point1, VECTOR2D Point2, double &Distance)
Calculate the distance between two points pointed to by two vectors.
Definition: MathExports.cpp:2659
VECTOR2D CreateVector2DFromPOINT(POINT Vertex)
Create a vector object and initializes it with the values taken from the specified POINT structure.
Definition: MathExports.cpp:2213

◆ GetPointLine2DDistance()

cvbres_t GetPointLine2DDistance ( LINE2D  Line,
VECTOR2D  Point,
double &  Distance 
)

Get the distance between a line and a point.

Parameters
[in]LineHandle of line object for the distance calculation.
[in]PointHandle of the point for the distance calculation.
[out]DistanceDistance between the point and the line.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
CreateVector2DFromPOINT

◆ GetVector2DCartesian()

cvbres_t GetVector2DCartesian ( VECTOR2D  Input,
double &  X,
double &  Y 
)

Get the Cartesian components of a 2D vector object.

Parameters
[in]InputHandle of vector for which to retrieve the Cartesian components.
[out]XX-component of the vector.
[out]YY-component of the vector.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetVector2DLength()

cvbres_t GetVector2DLength ( VECTOR2D  Input,
double &  Length 
)

Get the length of a vector object.

Parameters
[in]InputHandle of vector for which to retrieve the length.
[out]LengthLength of the vector.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetVector2DRadial()

cvbres_t GetVector2DRadial ( VECTOR2D  Input,
ANGLE Angle,
double &  Radius 
)

Get the radial coordinates of a 2D vector object.

Parameters
[in]InputHandle of vector for which to retrieve the radial coordinates.
[out]AngleRadial coordinate.
Attention: This object must be released with the ReleaseObject function once it is no longer needed!
[out]RadiusRadius coordinate of the angle.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ InnerProduct2D()

cvbres_t InnerProduct2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
double &  Result 
)

Calculates the inner product of two vectors.

Parameters
[in]Vector1Handle of first vector object.
[in]Vector2Handle of second vector object.
[out]ResultInner product of both vectors.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsAngle()

BOOL IsAngle ( ANGLE  Handle)

Checks whether a handle points to an angle object or not.

Parameters
[in]HandleHandle to be checked.
Returns
TRUE indicates that it is a valid angle object, FALSE otherwise.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsAntiParallelVector2D()

cvbres_t IsAntiParallelVector2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
cvbbool_t &  Result 
)

Checks whether two vectors are anti parallel (i.e. parallel but pointing into different directions).

Parameters
[in]Vector1Handle of first vector object to be checked.
[in]Vector2Handle of second vector object to be checked.
[out]ResultTRUE indicates that both vectors are anti parallel, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsCircle2D()

BOOL IsCircle2D ( CIRCLE2D  Handle)

Checks whether a handle points to a circle object or not.

Parameters
[in]HandleHandle to be checked.
Returns
TRUE indicates that it is a valid circle object, FALSE otherwise.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsEqualCircle2D()

cvbres_t IsEqualCircle2D ( CIRCLE2D  Circle1,
CIRCLE2D  Circle2,
cvbbool_t &  Result 
)

Checks whether two circles are equal.

Parameters
[in]Circle1Handle of first circle to be checked.
[in]Circle2Handle of second circle to be checked.
[out]ResultTRUE if the circles are identical, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsEqualLine2D()

cvbres_t IsEqualLine2D ( LINE2D  Line1,
LINE2D  Line2,
cvbbool_t &  Result 
)

Checks two line objects for equality.

Parameters
[in]Line1Handle of first line to be checked.
[in]Line2Handle of second line to be checked.
[out]ResultTRUE if the lines are identical, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsEqualVector2D()

cvbres_t IsEqualVector2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
cvbbool_t &  Result 
)

Checks two vector objects for equality.

Parameters
[in]Vector1Handle of first vector to be checked.
[in]Vector2Handle of second vector to be checked.
[out]ResultTRUE if the vectors are identical, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsLine2D()

BOOL IsLine2D ( LINE2D  Handle)

Checks whether a handle points to an line object or not.

Parameters
[in]HandleHandle to be checked.
Returns
TRUE indicates that it is a valid line object, FALSE otherwise.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsLine2DParallel()

cvbres_t IsLine2DParallel ( LINE2D  Line1,
LINE2D  Line2,
cvbbool_t &  Result 
)

Checks whether two line objects are parallel.

Parameters
[in]Line1Handle of first line object to be checked.
[in]Line2Handle of second line object to be checked.
[out]ResultTRUE if the lines are parallel, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsLine2DPerpendicular()

cvbres_t IsLine2DPerpendicular ( LINE2D  Line1,
LINE2D  Line2,
cvbbool_t &  Result 
)

Checks whether two line objects are perpendicular.

Parameters
[in]Line1Handle of first line object to be checked.
[in]Line2Handle of second line object to be checked.
[out]ResultTRUE if the lines are perpendicular, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsParallelVector2D()

cvbres_t IsParallelVector2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
cvbbool_t &  Result 
)

Checks whether two vector objects are parallel.

Parameters
[in]Vector1Handle of first vector to be checked.
[in]Vector2Handle of second vector to be checked.
[out]ResultTRUE if the vectors are parallel, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsPerpendicularVector2D()

cvbres_t IsPerpendicularVector2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
cvbbool_t &  Result 
)

Checks whether two vector objects are perpendicular.

Parameters
[in]Vector1Handle of first vector to be checked.
[in]Vector2Handle of second vector to be checked.
[out]ResultTRUE if the vectors are perpendicular, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsPointInCircle2D()

cvbres_t IsPointInCircle2D ( CIRCLE2D  Circle,
double  PointX,
double  PointY,
cvbbool_t &  Result 
)

Checks whether a given point is inside a circle.

Parameters
[in]CircleHandle of circle for the check.
[in]PointXX-coordinate of the location to be checked.
[in]PointYY-coordinate of the location to be checked.
[out]ResultTRUE if the point is inside the given circle, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsPointOnCircle2DRadius()

cvbres_t IsPointOnCircle2DRadius ( CIRCLE2D  Circle,
double  PointX,
double  PointY,
double  Epsilon,
cvbbool_t &  Result 
)

Checks whether a point is on the radius (or within a small epsilon environment of the radius) of a circle object.

Parameters
[in]CircleHandle of circle for the check.
[in]PointXX-coordinate of the location to be checked.
[in]PointYY-coordinate of the location to be checked.
[in]EpsilonSize of the environment for the check.
[out]ResultTRUE if the point is on the radius of the circle, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ IsVector2D()

BOOL IsVector2D ( LINE2D  Handle)

Checks whether a handle points to a VECTOR2D object or not.

Parameters
[in]HandleHandle to be checked.
Returns
TRUE indicates that it is a valid vector object, FALSE otherwise.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ MultiplyAngle()

cvbres_t MultiplyAngle ( ANGLE  Angle,
double  Constant 
)

Multiply an angle with a (dimension-free) number.

Attention
The Angle is automatically cut down to the range [Pi...Pi[.
Parameters
[in]AngleAngle object to be multiplied.
[in]ConstantConstant with which to multiply the angle.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ MultiplyVector2D()

cvbres_t MultiplyVector2D ( VECTOR2D  Vector,
double  Scalar,
VECTOR2D Result 
)

Multiply a vector with a scalar.

Parameters
[in]VectorHandle of vector to be multiplied.
[in]ScalarScalar with which to multiply the vector.
[out]ResultHandle of the result vector.
Attention: This object must be released with the ReleaseObject function once it is no longer needed!
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetAngleArgument()

cvbres_t SetAngleArgument ( ANGLE  Angle,
double  X,
double  Y 
)

Set an angle to a new value which is defined as the angle between the x-axis and the line connecting the origin to a point (X,Y).

Parameters
[in]AngleHandle of angle object to be changed.
[in]XX-coordinate of the point defining the new angle.
[in]YY-coordinate of the point defining the new angle.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetAngleDegrees()

cvbres_t SetAngleDegrees ( ANGLE  Angle,
double  Degrees 
)

Set an angle object to a new value.

Attention
The angle is automatically cut down to the range [-180..180[.
Parameters
[in]AngleHandle of angle object to be changed.
[in]DegreesNew value to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetAngleLUTGranularityDeg()

void SetAngleLUTGranularityDeg ( double  Granularity)

Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations.

The size (and therefore the precision) of these lookup tables depends on the granularity with which they were generated.
The lookup tables are automatically used by the functions \ref GetAngleSine, \ref GetAngleCosine and \ref GetAngleTangent.
Parameters
[in]GranularityGranularity with which to generate the lookup table.
If the granularity is 0 or less, then no lookup table will be used internally.
Supported platforms:
Win32
Win64
Related Topics:
GetAngleSine, GetAngleCosine, GetAngleTangent

◆ SetAngleLUTGranularityRad()

void SetAngleLUTGranularityRad ( double  Granularity)

Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations.

The size (and therefore the precision) of these lookup tables depends on the granularity with which they were generated.
The lookup tables are automatically used by the functions \ref GetAngleSine, \ref GetAngleCosine and \ref GetAngleTangent.
Parameters
[in]GranularityGranularity with which to generate the lookup table.
If the granularity is 0 or less, then no lookup table will be used internally.
Supported platforms:
Win32
Win64
Related Topics:
GetAngleSine, GetAngleCosine, GetAngleTangent
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetAngleRadians()

cvbres_t SetAngleRadians ( ANGLE  Angle,
double  Radians 
)

Set an angle object to a new value.

Parameters
[in]AngleHandle of angle object.
[out]RadiansNew value to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetLine2DAnalytical()

cvbres_t SetLine2DAnalytical ( LINE2D  Line,
double  A,
double  B,
cvbbool_t  AxplusB 
)

Change a line object according to its analytical formula.

Parameters
[in]LineHandle of line object to be modified.
[in]ASteepness parameter of the line.
[in]BOffset parameter of the line.
[in]AxplusBSpecifies the formula to be used to define the line
TRUE: y = A * x + B (cannot define a vertical line)
FALSE: x = A * y + B (cannot define a horizontal line)
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetLine2DByRegression()

cvbres_t SetLine2DByRegression ( LINE2D  Line,
PIXELLIST  RegressionList 
)

Modifies a 2D line object by performing a linear regression over an input pixel list.

Parameters
[in]LineHandle of line object to be modified.
[in]RegressionListList of pixels that define the line.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
Datatype Pixellist - see Image DLL

◆ SetLine2DDistanceOrientation()

cvbres_t SetLine2DDistanceOrientation ( LINE2D  Line,
double  Distance,
ANGLE  Direction 
)

Modifies a line 2D object by specifying its distance from the origin and the direction in which the line is running (direction of the tangent on the circle around the origin with radius r).

Parameters
[in]LineHandle of line object to be modified.
[in]DistanceLine's distance from the origin.
[in]DirectionDirection of the line.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetLine2DInclination()

cvbres_t SetLine2DInclination ( LINE2D  Line,
ANGLE  Inclination 
)

Change the inclination of a line object.

Parameters
[in]LineHandle of line object to be changed.
[in]InclinationNew inclination to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetLine2DNormalVector()

cvbres_t SetLine2DNormalVector ( LINE2D  Line,
VECTOR2D  Normal 
)

Redefine a line by changing its normal vector.

Parameters
[in]LineHandle of line object to be changed.
[in]NormalNew normal vector to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetLine2DOriginDistance()

cvbres_t SetLine2DOriginDistance ( LINE2D  Line,
double  Distance 
)

Change the distance of a line from the origin.

Parameters
[in]LineHandle of line object to be changed.
[in]DistanceNew distance to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetLine2DTwoPoints()

cvbres_t SetLine2DTwoPoints ( LINE2D  Line,
VECTOR2D  Point1,
VECTOR2D  Point2 
)

Change a line object by specifying two points the line should cross.

Parameters
[in]LineHandle of line object to be changed.
[in]Point1Handle of first point defining the new line.
[in]Point2Handle of second point defining the new line.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D
CreateVector2DFromPOINT

◆ SetVector2DCartesian()

cvbres_t SetVector2DCartesian ( VECTOR2D  Input,
double  X,
double  Y 
)

Set the Cartesian components of a 2D vector object.

Parameters
[in]InputHandle of vector object to be modified.
[in]XNew X-coordinate to be set.
[in]YNew Y-coordinate to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SetVector2DRadial()

cvbres_t SetVector2DRadial ( VECTOR2D  Input,
ANGLE  Angle,
double  Radius 
)

Set a 2D vector object to new radial coordinates.

Parameters
[in]InputHandle of vector object to be modified.
[in]AngleNew angle coordinate to be set.
[in]RadiusNew radius coordinate to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SubtractAngles()

cvbres_t SubtractAngles ( ANGLE  Angle1,
ANGLE  Angle2,
ANGLE Diff 
)

Subtracts two angle objects.

Automatically takes care of the fact that the angles wrap around at -Pi and +Pi.
Parameters
[in]Angle1First angle to be subtracted.
[in]Angle2Second angle to be subtracted.
[out]DiffHandle of result angle containing the difference (Angle1 - Angle2).
Attention: Handle must be released with the ReleaseObject when no longer needed.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ SubtractVectors2D()

cvbres_t SubtractVectors2D ( VECTOR2D  Vector1,
VECTOR2D  Vector2,
VECTOR2D Result 
)

Build the difference of two vectors.

Parameters
[in]Vector1First vector for the subtraction.
[in]Vector2Second vector for the subtraction.
[out]ResultNewly created result vector containing the difference (Vector1 - Vector2 ).
Attention: Handle must be released with the ReleaseObject when no longer needed.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D