PyANGKernel.GKPoint

class GKPoint

Synopsis

Methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

This 3d point can contain the (x, y, z) coordinates of a point. It can be used to contain a 2d point as most of the methods have a default z value asigned to 0.

PyANGKernel.GKPoint.x
PyANGKernel.GKPoint.y
PyANGKernel.GKPoint.z
PyANGKernel.GKPoint.zero
__init__()
__init__(v)
Parameters:

vGKVector

__init__(ax, ay[, az=0.0f])
Parameters:
  • ax – float

  • ay – float

  • az – float

almostDifferents(c, factor)
Parameters:
Return type:

bool

Returns true if “this” point is different from “c” (first parameter) after multiplying the coordinates by a factor (second parameter) and comparing each one as integers

areEqual(c, epsilon)
Parameters:
Return type:

bool

Returns true if both points are close enough taking into account the epsilon (in m) provided as second parameter. All x, y, and z are taken into account.

areEqual2D(c, epsilon)
Parameters:
Return type:

bool

Returns true if both points are close enough taking into account the epsilon (in m) provided as second parameter. Only the 2D coordinates of the points (x and y) are taken into account

betweenPoints(p1, p2, epsilon)
Parameters:
Return type:

bool

Supposing that all three points pertain to the same line, returns true if this is located between p1 and p2; false otherwise. The epsilon is the distance in m allowed for distorsion

closestPtPointSegment(a, b, t)
Parameters:
Return type:

GKPoint

Given segment ab and this point, computes closest point on ab and returns it. Also returns t for the position of d, d(t) = a + t*(b - a)

distance2D(c)
Parameters:

cGKPoint

Return type:

float

Distance between “this” point and point “c” without use Z coordinate.

distance3D(c)
Parameters:

cGKPoint

Return type:

float

Distance between “this” point and point “c”.

static fromString(str)
Parameters:

str – str

Return type:

GKPoint

A point is created from a string having the format x,y,z x, y and z coordinates can have different sizes

getAngleHorizontalInDegs(p2)
Parameters:

p2GKPoint

Return type:

float

Returns the angle that the segment defined by this point and “point” makes with the horitzontal. Between GKPI and -GKPI

getAngleHorizontalInRads(p2)
Parameters:

p2GKPoint

Return type:

float

Returns the angle that the segment defined by this point and “point” makes with the horitzontal. Between GKPI and -GKPI

getMinAngleHorizontalInRads(point)
Parameters:

pointGKPoint

Return type:

float

Returns the angle that the line defined by this point and “point” makes with the horitzontal. Between GKPI/2 and -GKPI/2

getMinAngleVerticalInRads(point)
Parameters:

pointGKPoint

Return type:

float

Returns the angle that the line defined by this point and “point” makes with the vertical. Between GKPI/2 and -GKPI/2

isNaN()
Return type:

bool

NaN detector

lDist(p2, distance)
Parameters:
  • p2GKPoint

  • distance – float

Return type:

GKPoint

Finds a point p in the line defined by this and p2, at distance “distance” from this going to p2

length()
Return type:

float

Length

lerp(p, f)
Parameters:
Return type:

GKPoint

Lerp: returns (1-f)this + pf

line2DPtp(p2)
Parameters:

p2GKPoint

Return type:

GKLine

Given a second point, returns the Line in 2 dimensions that goes by them. If the line is vertical, it is codified with slope = DBL_MA and coef = x constant

lineCrossProduct(aLinePoint, aXIncrement, aYIncrement)
Parameters:
  • aLinePointGKPoint

  • aXIncrement – float

  • aYIncrement – float

Return type:

float

minDistanceToLine(aLinePoint1, aLinePoint2)
Parameters:
Return type:

float

normalized()
Return type:

GKPoint

Unit vector pointing in the same direction

__ne__(c)
Parameters:

cGKPoint

Return type:

bool

Operator that returns true if the two compared points are different. This operator returns false if the points are equal.

__mul__(c)
Parameters:

cGKPoint

Return type:

float

Dot product

__mul__(c)
Parameters:

c – float

Return type:

GKPoint

__imul__(f)
Parameters:

f – float

Return type:

GKPoint

__add__(c)
Parameters:

cGKPoint

Return type:

GKPoint

Operator that adds one point to another.

__add__(c)
Parameters:

cGKVector

Return type:

GKPoint

Operator that adds one vector to a point.

__add__(c)
Parameters:

c – float

Return type:

GKPoint

__iadd__(c)
Parameters:

cGKPoint

Return type:

GKPoint

Operator that adds one point to another.

__sub__()
Return type:

GKPoint

Negative operator

__sub__(c)
Parameters:

cGKPoint

Return type:

GKVector

Operator that subtracts one point to another.

__sub__(c)
Parameters:

cGKVector

Return type:

GKPoint

Operator that subtracts one vector to a point.

__sub__(c)
Parameters:

c – float

Return type:

GKPoint

__isub__(c)
Parameters:

cGKPoint

Return type:

GKPoint

Operator that subtracts one point to another.

__div__(c)
Parameters:

c – float

Return type:

GKPoint

Operator that divides a scalar to all point components

__lt__(rhs)
Parameters:

rhsGKPoint

Return type:

bool

__le__(rhs)
Parameters:

rhsGKPoint

Return type:

bool

operator=(c)
Parameters:

cGKVector

Return type:

GKPoint

Assignment from vector.

operator=(l)
Parameters:

l – .std.arraydouble,3

Return type:

GKPoint

Assignment from vector.

__eq__(c)
Parameters:

cGKPoint

Return type:

bool

Operator that returns true if the two compared points are equal. This operator returns false if the points are different.

__gt__(rhs)
Parameters:

rhsGKPoint

Return type:

bool

__ge__(rhs)
Parameters:

rhsGKPoint

Return type:

bool

operator(i)
Parameters:

i – int

Return type:

float

pointAtDistance(p, d, res)
Parameters:
Return type:

bool

Fills the point ‘res’ that is on the line that goes to point ‘p’ at distance ‘d’ If the value returnen is ‘false’ then an error occourred and ‘res’ is not filled

reset()
rotate2D(center, angle)
Parameters:
  • centerGKPoint

  • angle – float

Return type:

GKPoint

Rotates this point, given a center and an angle in radians. The rotated point is returned and this one is not modified

rotate2DThis(center, angle)
Parameters:
  • centerGKPoint

  • angle – float

Rotates this point, given a center and an angle in radians, modifying it.

set(ax, ay[, az=0.0f])
Parameters:
  • ax – float

  • ay – float

  • az – float

Sets the (x, y, z) coordinates of the point.

toString()
Return type:

str

Returns a QString having the format x,y,z

translateAtAngleByDistance(aAngle, aDistance)
Parameters:
  • aAngle – float

  • aDistance – float

Translates this point at an angle to a given distance