Foundation (CVFoundation.dll) 14.0
Math Helper Functions

Functions

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

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...

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...

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...

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...

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...

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...

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

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...

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...

Function Documentation

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

Automatically takes care of the fact that the angles wrap around at -Pi and +Pi.

Parameters
 [in] Angle1 First angle to be added. [in] Angle2 Second angle to be added. [out] Sum Handle 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

 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] Vector Vector to be added to the pixel list. [in,out] List List 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

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

Build the sum of two vectors.

Parameters
 [in] Vector1 First vector to be added. [in] Vector2 Second vector to be added. [out] Result Handle 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] pl Pixel list. [out] centerX Center of the circle (x coordinate in the same units the pixel list is using). [out] centerY Center of the circle (y coordinate in the same units the pixel list is using). [out] radius Radius 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] pl Pixel list. [out] centerX Center of the ellipse (x coordinate in the same units the pixel list is using). [out] centerY Center of the ellipse (y coordinate in the same units the pixel list is using). [out] radiusA Semi major radius of the ellipse (in the same units the pixel list is using). [out] radiusB Semi major radius of the ellipse (in the same units the pixel list is using). [out] rotation Rotation 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] Angle1 First angle for comparison. [in] Angle2 Second angle for comparison. [out] Result Result 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] X X-coordinate of the point. [in] Y Y-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] Deg Initialization 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

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
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] RegressionList Pixel 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] CenterX X-coordinate of the circle's center. [in] CenterY Y-coordinate of the circle's center. [in] Radius Radius 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] A Steepness parameter of the line. [in] B Offset parameter of the line. [in] AxplusB Specifies 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] RegressionList List 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] Distance Line's distance from the origin. [in] Direction Direction 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] Normal Vector that is perpendicular on the line. [in] Distance Line'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] Point1 First point on the line. [in] Point2 Second 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] Vector Point on the line [in] Direction Direction 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] Input Handle of input vector. [out] Output Handle 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] Input Handle of input vector. [out] Output Handle 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] Line Handle of input line object. [in] Point Point 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] X X-component of the vector. [in] Y Y-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] Vertex Point 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

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] Ang Angle coordinate of the vector. [in] Radius Radius 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] Line Handle of line object to calculate the intersection for. [in] ClippingRect Rectangle with which to intersect the line. [out] Clip1 Handle 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] Clip2 Handle 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] Angle Handle of angle object. [out] Cosine Cosine of the angle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetAngleDegrees()

 cvbres_t GetAngleDegrees ( ANGLE Angle, double & Degrees )

Get an angle object's value in degrees.

Parameters
 [in] Angle Handle of angle object. [out] Degrees Current 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

Get an angle object's value in radians.

Parameters
 [in] Angle Handle of angle object. [out] Radians Current 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] Angle Handle of angle object. [out] Sine Sine of the angle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ 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] Angle Handle of angle object. [out] Tangent Tangent of the angle object.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

◆ GetCircle2DCenter()

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

Retrieve the center of a circle object.

Parameters
 [in] Circle Handle of circle object. [out] CenterX X-coordinate of the circle's center. [out] CenterY Y-coordinate of the circle's center.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

Retrieve the radius of a circle object.

Parameters
 [in] Circle Handle of circle object. [out] Radius Radius 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] Circle Circle2D Circle fitted into the point list (e.g. by regression). [in] PointList PIXELLIST Measured points, the circle is created from [out] Roundness double& 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] Line Handle of line object. [out] A Slope parameter of the formula. [out] B Offset 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] Line Handle of line object. [out] A Slope parameter of the formula. [out] B Offset 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] Line Handle of line object to retrieve the inclination for. [out] Inclination Inclination 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] Line1 Handle of first line object for the intersection. [in] Line2 Handle of second line object for the intersection. [out] Intersection Intersection 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] Line1 Handle of first line object for the intersection. [in] Line2 Handle of second line object for the intersection. [out] Result Intersection 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] Line Handle of line object for which to calculate the normal vector. [out] Vector Normal 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] Line Handle of line object for which to retrieve the distance. [out] Distance Distance 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] Line Handle of line object. [out] Vector Vector 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] Angle Angle 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] LineArray Array of handles to line objects for which to calculate the intersection approximation. [in] ArrayLength Length of the line array. [in] ConvergenceThreshold Threshold 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] MaxIterations Number of iterations after which to stop the iteration process. Specifying -1 will run indefinitely. [out] Point Intersection 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] Point1 Vector pointing to first point. [in] Point2 Vector pointing to second point. [out] Distance Distance 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] Line Handle of line object for the distance calculation. [in] Point Handle of the point for the distance calculation. [out] Distance Distance 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] Input Handle of vector for which to retrieve the Cartesian components. [out] X X-component of the vector. [out] Y Y-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] Input Handle of vector for which to retrieve the length. [out] Length Length of the vector.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

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

Get the radial coordinates of a 2D vector object.

Parameters
 [in] Input Handle of vector for which to retrieve the radial coordinates. [out] Angle Radial coordinate. Attention: This object must be released with the ReleaseObject function once it is no longer needed! [out] Radius Radius 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] Vector1 Handle of first vector object. [in] Vector2 Handle of second vector object. [out] Result Inner 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] Handle Handle 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] Vector1 Handle of first vector object to be checked. [in] Vector2 Handle of second vector object to be checked. [out] Result TRUE 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] Handle Handle 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] Circle1 Handle of first circle to be checked. [in] Circle2 Handle of second circle to be checked. [out] Result TRUE 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] Line1 Handle of first line to be checked. [in] Line2 Handle of second line to be checked. [out] Result TRUE 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] Vector1 Handle of first vector to be checked. [in] Vector2 Handle of second vector to be checked. [out] Result TRUE 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] Handle Handle 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] Line1 Handle of first line object to be checked. [in] Line2 Handle of second line object to be checked. [out] Result TRUE 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] Line1 Handle of first line object to be checked. [in] Line2 Handle of second line object to be checked. [out] Result TRUE 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] Vector1 Handle of first vector to be checked. [in] Vector2 Handle of second vector to be checked. [out] Result TRUE 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] Vector1 Handle of first vector to be checked. [in] Vector2 Handle of second vector to be checked. [out] Result TRUE 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] Circle Handle of circle for the check. [in] PointX X-coordinate of the location to be checked. [in] PointY Y-coordinate of the location to be checked. [out] Result TRUE 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

 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] Circle Handle of circle for the check. [in] PointX X-coordinate of the location to be checked. [in] PointY Y-coordinate of the location to be checked. [in] Epsilon Size of the environment for the check. [out] Result TRUE 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] Handle Handle 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] Angle Angle object to be multiplied. [in] Constant Constant 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] Vector Handle of vector to be multiplied. [in] Scalar Scalar with which to multiply the vector. [out] Result Handle 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] Angle Handle of angle object to be changed. [in] X X-coordinate of the point defining the new angle. [in] Y Y-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] Angle Handle of angle object to be changed. [in] Degrees New 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] Granularity Granularity 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

 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] Granularity Granularity 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

Set an angle object to a new value.

Parameters
 [in] Angle Handle of angle object. [out] Radians New 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] Line Handle of line object to be modified. [in] A Steepness parameter of the line. [in] B Offset parameter of the line. [in] AxplusB Specifies 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] Line Handle of line object to be modified. [in] RegressionList List 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] Line Handle of line object to be modified. [in] Distance Line's distance from the origin. [in] Direction Direction 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] Line Handle of line object to be changed. [in] Inclination New 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] Line Handle of line object to be changed. [in] Normal New 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] Line Handle of line object to be changed. [in] Distance New 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] Line Handle of line object to be changed. [in] Point1 Handle of first point defining the new line. [in] Point2 Handle 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] Input Handle of vector object to be modified. [in] X New X-coordinate to be set. [in] Y New Y-coordinate to be set.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
ANGLE, CIRCLE2D, VECTOR2D, LINE2D

Set a 2D vector object to new radial coordinates.

Parameters
 [in] Input Handle of vector object to be modified. [in] Angle New angle coordinate to be set. [in] Radius New 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] Angle1 First angle to be subtracted. [in] Angle2 Second angle to be subtracted. [out] Diff Handle 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] Vector1 First vector for the subtraction. [in] Vector2 Second vector for the subtraction. [out] Result Newly 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