VrOne/Python Programming
|
ON-LINE REFERENCE DOCUMENTATION CARDINAL SYSTEMS, LLC |
The VrOne/Python Geometry class includes helper coordinate geometry
routines. More...
The Python VrOne Geometry Class contains useful coordinate
geometry routines. The Python calls into
this call use the same coordinate geometry routines used by VrOne. This class is provided to reduce user
development time by using time-tested VrOne C++ routines
Converts an
angle from (to) clockwise North to (from) counterclockwise from East.
|
Angle |
|
Computes North
Azimuth from 2 coordinate positions.
|
x1 |
Point 1 |
|
|
y1 |
Point 1 |
|
|
x2 |
Point 2 |
|
|
y2 |
Point 2 |
|
|
returns |
(ret) |
|
|
|
ret |
Azimuth clockwise from North in
radians. |
Computes South
Azimuth from 2 coordinate positions.
|
x1 |
Point 1 |
|
|
y1 |
Point 1 |
|
|
x2 |
Point 2 |
|
|
y2 |
Point 2 |
|
|
returns |
(ret) |
|
|
|
ret |
Azimuth clockwise from South in
radians. |
Computes East
Azimuth from 2 coordinate positions.
This angle is normally used for text rotations.
|
x1 |
Point 1 |
|
|
y1 |
Point 1 |
|
|
x2 |
Point 2 |
|
|
y2 |
Point 2 |
|
|
returns |
(ret) |
|
|
|
ret |
Azimuth counterclockwise from
East in radians. |
Returns the
delta angle between two azimuths.
Always returns the acute angle.
|
Azi1 |
Azimuths 1 to compare (radians) |
|
|
Azi2 |
Azimuths 2 to compare (radians) |
|
|
returns |
(ret) |
|
|
|
ret |
Delta angle Example (in
degrees): Azi1 = 350 Azi2 = 10 returns 20 |
Computes the 2D
distance between two points.
|
x1 |
Point 1 |
|
|
y1 |
Point 1 |
|
|
x2 |
Point 2 |
|
|
y2 |
Point 2 |
|
|
returns |
(ret) |
|
|
|
ret |
Distance. |
Computes zenith
angle from two 3D points.
|
x1 |
Point 1 |
|
|
y1 |
Point 1 |
|
|
z1 |
Point 1 |
|
|
x2 |
Point 2 |
|
|
y2 |
Point 2 |
|
|
z2 |
Point 1 |
|
|
returns |
(ret) |
|
|
|
ret |
Zenith angle (radians) |
Determines if line1 is shorter
than line2
|
x1 |
Line 1 Point 1. |
|
|
y1 |
Line 1 Point 1. |
|
|
x2 |
Line 1 Point 2. |
|
|
y2 |
Line 1 Point 2. |
|
|
x3 |
Line 2 Point 1. |
|
|
y3 |
Line 2 Point 1. |
|
|
x4 |
Line 2 Point 2. |
|
|
y4 |
Line 2 Point 2. |
|
|
returns |
(ret) |
|
|
|
ret |
0 Line1 is shorter that Line2 1
Line1 is longer than or equal to Line2 |
Computes slope distance between
two 3D points.
|
x1 |
Point 1 |
|
|
y1 |
Point 1 |
|
|
z1 |
Point 1 |
|
|
x2 |
Point 2 |
|
|
y2 |
Point 2 |
|
|
z2 |
Point 2 |
|
|
returns |
(ret) |
|
|
|
ret |
Slope distance |
Returns the relationship of a point within a window | | 9 | 1 | 5 | | ----------------------- < MaxY |///////| 8 |///0///| 4 |///////| ----------------------- < MinY | | 10 | 2 | 6 | | ^ ^ MinX MaxX
|
MinX |
Window bounds |
|
MinY |
Window bounds |
|
MaxX |
Window bounds |
|
MaxY |
Window bounds |
|
TestX |
Test point |
|
TestY |
Test point |
Interpolates the unknown Y of three
points.
|
X1 |
Point 1 X. |
|
|
Y1 |
Point 1 Y. |
|
|
X2 |
Point 2 X. |
|
|
Y2 |
Point 2 Y. |
|
|
X3 |
Known X of point 3. |
|
|
|
|
|
|
returns |
(UnknownY)
|
|
|
|
UnknownY |
|
Interpolates the unknown X of three
points.
|
Y3 |
Known Y of point 3. |
|
|
X1 |
Point 1. |
|
|
Y1 |
Point 1. |
|
|
X2 |
Point 2. |
|
|
Y2 |
Point 2. |
|
|
|
|
|
|
returns |
(UnknownX)
|
|
|
|
UnknownX |
|
Interpolates the XY position along a line based on the
elevation
|
x1 |
Point one |
|
|
y1 |
Point one |
|
|
z1 |
Point one |
|
|
x2 |
Point two |
|
|
y2 |
Point two |
|
|
z2 |
Point two |
|
|
z3 |
Known elevation |
|
|
returns |
(x3, y3) |
|
|
|
x3 |
Return X |
|
|
y3 |
Return Y |
Interpolates the unknown elevation of
three points.
|
x1 |
Point one |
|
|
y1 |
Point one |
|
|
z1 |
Point one |
|
|
x2 |
Point two |
|
|
y2 |
Point two |
|
|
z2 |
Point two |
|
|
x3 |
Known x of third point. |
|
|
y3 |
Known y of third point. |
|
|
returns |
(z3) |
|
|
|
z3 |
Unknown elevation of third point.
If there is no distance between points one and two then Z3 returns with the
elevation of Z1. |
Interpolates a Z from a 3D surface
defined by a triangle.
|
x1 |
Point one on triangle |
|
|
y1 |
Point one on triangle |
|
|
z1 |
Point one on triangle |
|
|
x2 |
Point two on triangle |
|
|
y2 |
Point two on triangle |
|
|
z2 |
Point two on triangle |
|
|
x3 |
Point three on triangle |
|
|
y3 |
Point three on triangle |
|
|
z3 |
Point three on triangle |
|
|
x |
Point to interpolate Z for. |
|
|
y |
Point to interpolate Z for. |
|
|
returns |
(z) |
|
|
|
z |
Return elevation. |
Rotates a point about a base point.
|
BaseX |
Base point. |
|
|
BaseY |
Base point. |
|
|
x |
Point to be rotated. |
|
|
y |
Point to be rotated. |
|
|
Rot |
Rotation clockwise in radians. |
|
|
returns |
(x, y) |
|
|
|
x |
Return point x. |
|
|
y |
Return point y. |
Computes the offset and distance from a point to a line.
|
LineX1 |
Point one of the line. |
|
|
LineY1 |
Point one of the line. |
|
|
LineX2 |
Point two of the line. |
|
|
LineY2 |
Point two of the line. |
|
|
PointX |
Point |
|
|
PointY |
Point |
|
|
returns |
||