OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Math Class Reference

#include "Math.h"

Static Public Member Functions

static double euclideanDistance (double _x1, double _y1, double _x2, double _y2)
 Calculates the Euclidean distance betwenn the two given points.
 
static double euclideanDistance (const Point2DD &_p1, const Point2DD &_p2)
 
static double calculateShortestDistanceFromPointToLine (double _px, double _py, double _x1, double _y1, double _x2, double _y2)
 Calculates the shortest distance from the given point to the given line.
 
static double calculateShortestDistanceFromPointToLine (const Point2DD &_pt, const Point2DD &_lineStart, const Point2DD &_lineEnd)
 
static Point2DD calculatePointOnBezierCurve (double _t, double _startX, double _startY, double _control1X, double _control1Y, double _control2X, double _control2Y, double _endX, double _endY)
 Calculates the point on the Bezier curve for a given t value.
 
static Point2DD calculatePointOnBezierCurve (double _t, const Point2DD &_start, const Point2DD &_control1, const Point2DD &_control2, const Point2DD &_end)
 
static double calculateShortestDistanceFromPointToBezierCurve (double _px, double _py, double _startX, double _startY, double _control1X, double _control1Y, double _control2X, double _control2Y, double _endX, double _endY)
 Calculates the minimum distance from a point to a cubic Bezier curve.
 
static double calculateShortestDistanceFromPointToBezierCurve (const Point2DD &_pt, const Point2DD &_start, const Point2DD &_control1, const Point2DD &_control2, const Point2DD &_end)
 

Member Function Documentation

◆ calculatePointOnBezierCurve() [1/2]

static Point2DD ot::Math::calculatePointOnBezierCurve ( double _t,
const Point2DD & _start,
const Point2DD & _control1,
const Point2DD & _control2,
const Point2DD & _end )
inlinestatic

◆ calculatePointOnBezierCurve() [2/2]

ot::Point2DD ot::Math::calculatePointOnBezierCurve ( double _t,
double _startX,
double _startY,
double _control1X,
double _control1Y,
double _control2X,
double _control2Y,
double _endX,
double _endY )
static

Calculates the point on the Bezier curve for a given t value.

Parameters
_tThe parameter value, ranging from 0 to 1, where 0 corresponds to the start of the curve and 1 corresponds to the end.
_startXBezier curve start point X.
_startYBezier curve start point Y.
_control1XBezier curve control point 1 X.
_control1YBezier curve control point 1 Y.
_control2XBezier curve control point 2 X.
_control2YBezier curve control point 2 Y.
_endXBezier curve end point X.
_endYBezier curve end point Y.

◆ calculateShortestDistanceFromPointToBezierCurve() [1/2]

static double ot::Math::calculateShortestDistanceFromPointToBezierCurve ( const Point2DD & _pt,
const Point2DD & _start,
const Point2DD & _control1,
const Point2DD & _control2,
const Point2DD & _end )
inlinestatic

◆ calculateShortestDistanceFromPointToBezierCurve() [2/2]

double ot::Math::calculateShortestDistanceFromPointToBezierCurve ( double _px,
double _py,
double _startX,
double _startY,
double _control1X,
double _control1Y,
double _control2X,
double _control2Y,
double _endX,
double _endY )
static

Calculates the minimum distance from a point to a cubic Bezier curve.

Parameters
_pxPoint X.
_pyPoint Y.
_startXBezier curve start point X.
_startYBezier curve start point Y.
_control1XBezier curve control point 1 X.
_control1YBezier curve control point 1 Y.
_control2XBezier curve control point 2 X.
_control2YBezier curve control point 2 Y.
_endXBezier curve end point X.
_endYBezier curve end point Y.

◆ calculateShortestDistanceFromPointToLine() [1/2]

static double ot::Math::calculateShortestDistanceFromPointToLine ( const Point2DD & _pt,
const Point2DD & _lineStart,
const Point2DD & _lineEnd )
inlinestatic

◆ calculateShortestDistanceFromPointToLine() [2/2]

double ot::Math::calculateShortestDistanceFromPointToLine ( double _px,
double _py,
double _x1,
double _y1,
double _x2,
double _y2 )
static

Calculates the shortest distance from the given point to the given line.

Parameters
_pxPoint X.
_pyPoint Y.
_x1Line Start X.
_y1Line Start Y.
_x2Line End X.
_y2Line End Y.

◆ euclideanDistance() [1/2]

static double ot::Math::euclideanDistance ( const Point2DD & _p1,
const Point2DD & _p2 )
inlinestatic

◆ euclideanDistance() [2/2]

double ot::Math::euclideanDistance ( double _x1,
double _y1,
double _x2,
double _y2 )
static

Calculates the Euclidean distance betwenn the two given points.

Parameters
_x1Point 1 X.
_y1Point 1 Y.
_x2Point 2 X.
_y2Point 2 Y.

The documentation for this class was generated from the following files: