Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ktm/math.h
Go to the documentation of this file.
1#pragma once
2
3#include <ktm/global.h>
4#include <math/Types.h>
5
6namespace sf
7{
8
9// Calculates the tangent lines between two circles.
10// Returns true when a conversion was executed successfully.
11//
13 int select,// Selection of tangent.
14 // A negative value means the tangent is on the ccw side
15 // of the line formed by c1 and c2.
16 // An absolute value larger than 1 means that the tangent
17 // is crossing the line formed by c1 and c2.
18 // A value of zero is ignored.
19 const Vector2D& c1,// Center vector of first circle.
20 double radius1,// Radius of first circle.
21 Vector2D& tg1,// Point where tangent touches the first circle.
22 const Vector2D& c2,// Center vector of second circle.
23 double radius2,// Radius of second circle.
24 Vector2D& tg2// Point where tangent touches the second circle.
25);
26
27// Returns false when the angle is 90 degree or 270 degree.
28// In that case the x values of both point are almost the same and
29// 'yofs' is assigned the value of p1.x.
31 const Vector2D& p, double angle,// Input values.
32 double& slope, double& yofs// Output values.
33);
34
35// Returns false when the coefficient is actually infinite.
36// In that case the x values of both point are almost the same and
37// 'yofs' is assigned the value of p1.x.
39 const Vector2D& p1, const Vector2D& p2,// Input values.
40 double& slope, double& yofs// Output values.
41);
42
43// Returns true if both lines intersect.
44//
46 const Vector2D& p11,// First point of first line.
47 const Vector2D& p12,// Second point of first line.
48 const Vector2D& p2,// A point of second line.
49 double angle2,// Angle of second line.
50 Vector2D& ip// Point of intersection.
51);
52
53// Returns true if circle and line intersect.
54//
56 const Vector2D& center,// Circle center point.
57 double radius,// Circle radius.
58 const Vector2D& p,// A point of the line.
59 double angle,// Angle of the line.
60 Vector2D& ip1,// First point of intersection.
61 Vector2D& ip2// Second point of intersection.
62);
63
64// Returns true if both lines intersect.
65//
67 const Vector2D& p11,// First point of first line.
68 const Vector2D& p12,// Second point of first line.
69 const Vector2D& p2,// A point of second line.
70 double angle2,// Angle of second line.
71 Vector2D& ip// Point of intersection.
72);
73
74}// namespace sf
#define _KTM_FUNC
Definition ktm/global.h:34
Definition Application.h:10
bool _KTM_FUNC GetLineValues(const Vector2D &p, double angle, double &slope, double &yofs)
bool _KTM_FUNC CalcTangent(int select, const Vector2D &c1, double radius1, Vector2D &tg1, const Vector2D &c2, double radius2, Vector2D &tg2)
bool _KTM_FUNC GetIntersection(const Vector2D &p11, const Vector2D &p12, const Vector2D &p2, double angle2, Vector2D &ip)