VrOne/Python Programming

ON-LINE REFERENCE DOCUMENTATION

CARDINAL SYSTEMS, LLC

www.cardinalsystems.net
 

 

PyVrGeom Class Reference

The VrOne/Python Geometry class includes helper coordinate geometry routines.  More...

Members


Detailed Description

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


Member Function Documentation

AziConv (Angle)

Converts an angle from (to) clockwise North to (from) counterclockwise from East.

Angle

 

AziNorth (x1, y1, x2, y2)

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.

AziSouth (x1, y1, x2, y2)

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.

AziEast (x1, y1, x2, y2)

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.

DeltaAng (Azi1, Azi2)

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

Dist (x1, y1, x2, y2)

Computes the 2D distance between two points.

x1

Point 1

y1

Point 1

x2

Point 2

y2

Point 2

returns

(ret)

 

ret

Distance.

ZenithAng (x1, y1, z1, x2, y2, z2)

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)

IsShorter (x1, y1, x2, y2, x3, y3, x4, y4)

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

SlopeDist (x1, y1, z1, x2, y2, z2)

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

Wind (MinX, MinY, MaxX, MaxY, TestX, TestY)

 
  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

InterY2D (X1, Y1, X2, Y2, X3, )

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

 

InterX2D (Y3, X1, Y1, X2, Y2, )

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

 

InterXY (x1, y1, z1, x2, y2, z2, z3)

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

InterElev (x1, y1, z1, x2, y2, z2, x3, y3)

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.

InterZ3 (x1, y1, z1, x2, y2, z2, x3, y3, z3, x, y)

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.

RotPoint (BaseX, BaseY, x, y, Rot)

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.

OfsInt (LineX1, LineY1, LineX2, LineY2, PointX, PointY)

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