|
INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications
NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities
FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities
Full Software Listings
DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
PEOPLE
Contributors
Users
Project
Download
Mailing lists
|
|
|
geom2d Namespace Reference
Simple 2D geometry.
More...
Classes |
class | Point |
class | Rect |
class | PolarPoint |
class | Line |
Functions |
bool | circleCircleIntersection (double a1, double b1, double r1, double a2, double b2, double r2, double &px, double &py, double &qx, double &qy) |
double | dist (const Line &l, const Point &p) |
| perpendicular distance from a point to an (infinite) line
|
Point | closestPointOnLine (const Line &line, const Point &point) |
| Returns the closest point to 'point' that lies on 'line'.
|
bool | lineLineIntersection (const Line &l1, const Line &l2, Point &p) |
void | convertToRhoAlpha (const Line &line, double &rho, double &alpha) |
double | rho (const Line &line) |
double | alpha (const Line &line) |
double | dist (const Point &p1, const Point &p2) |
| Distance between points.
|
double | dist (const PolarPoint &p1, const PolarPoint &p2) |
| Distance between points.
|
double | distSq (const Point &p1, const Point &p2) |
| Squared distance between points.
|
double | distSq (const PolarPoint &p1, const PolarPoint &p2) |
| Squared distance between points.
|
bool | operator== (const Point &p1, const Point &p2) |
| equality
|
bool | operator!= (const Point &p1, const Point &p2) |
| equality
|
void | rotate (Point &p, double theta) |
| Rotate points about the origin.
|
void | rotate (const Point &p, double theta, Point &q) |
| Rotate points about the origin.
|
void | addTransform (Point &p, double x, double y, double theta) |
void | addTransform (const Point &p, double x, double y, double theta, Point &tp) |
void | subtractTransform (Point &p, double x, double y, double theta) |
void | subtractTransform (const Point &p, double x, double y, double theta, Point &tp) |
bool | circleCircleIntersection (const Point &c1, double r1, const Point &c2, double r2, Point &p, Point &q) |
| Convenience function. Circle centres are c1 and c2.
|
double | dotProduct (double v1[2], double v2[2]) |
| Dot-product of two 2D vectors.
|
Point | closestPointToOrigin (const Line &l) |
| Returns the point on the line that's closest to the origin.
|
Detailed Description
Simple 2D geometry.
This is a small library for simple 2D geometry.
- See also:
- libHydroGeom2d
Function Documentation
void geom2d::addTransform |
( |
const Point & |
p, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
theta, |
|
|
Point & |
tp | |
|
) |
| | [inline] |
add a transformation (x,y,theta) to a point (rotate then translate)
References rotate().
void geom2d::addTransform |
( |
Point & |
p, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
theta | |
|
) |
| | [inline] |
add a transformation (x,y,theta) to a point (rotate then translate)
References rotate().
SOEXPORT double geom2d::alpha |
( |
const Line & |
line |
) |
|
Polar coords: (rho,alpha) is the length and angle of a perpendicular bisector from the origin.
SOEXPORT bool geom2d::circleCircleIntersection |
( |
double |
a1, |
|
|
double |
b1, |
|
|
double |
r1, |
|
|
double |
a2, |
|
|
double |
b2, |
|
|
double |
r2, |
|
|
double & |
px, |
|
|
double & |
py, |
|
|
double & |
qx, |
|
|
double & |
qy | |
|
) |
| | |
Find the intersection points of two circles. Returns false if they don't meet. Returns true if they do (and possibly a repeated intersection point if they meet at one point).
Circle equation for centre=(a,b), radius=r is: (x-a)^2 + (y-b)^2 = r^2
Throws exceptions (std::string) for problems such as negative radius or co-incident circles.
Referenced by circleCircleIntersection().
SOEXPORT void geom2d::convertToRhoAlpha |
( |
const Line & |
line, |
|
|
double & |
rho, |
|
|
double & |
alpha | |
|
) |
| | |
Polar coords: (rho,alpha) is the length and angle of a perpendicular bisector from the origin.
SOEXPORT bool geom2d::lineLineIntersection |
( |
const Line & |
l1, |
|
|
const Line & |
l2, |
|
|
Point & |
p | |
|
) |
| | |
Intersection between two lines. Returns false if the lines don't intersect.
SOEXPORT double geom2d::rho |
( |
const Line & |
line |
) |
|
Polar coords: (rho,alpha) is the length and angle of a perpendicular bisector from the origin.
void geom2d::subtractTransform |
( |
const Point & |
p, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
theta, |
|
|
Point & |
tp | |
|
) |
| | [inline] |
subtract a transformation (x,y,theta) from a point (translate then rotate)
References rotate().
void geom2d::subtractTransform |
( |
Point & |
p, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
theta | |
|
) |
| | [inline] |
subtract a transformation (x,y,theta) from a point (translate then rotate)
References rotate().
|
|