PyANGKernel.GKLine¶
- class GKLine¶
Synopsis¶
Methods¶
def
__init__()def
contains()def
distToPoint2D()def
intersects()def
rotate()def
set()
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¶
Class that defines a 2D line and contains methods for the most common greometrical operations over a line.
- PyANGKernel.GKLine.slope¶
- PyANGKernel.GKLine.coef¶
- PyANGKernel.GKLine.fromX¶
- PyANGKernel.GKLine.fromY¶
- PyANGKernel.GKLine.toX¶
- PyANGKernel.GKLine.toY¶
- __init__()¶
- __init__(p1, slope)
- Parameters:
p1 –
GKPointslope – float
Returns the minimum angle in radians ( between 0 and GKPI/2) this two lines make. If lines are parallel DBL_MAX is returned. If lines are the same 0 is returned.
Returns the minimum angle in radians (between -GKPI and GKPI) this two lines make. If lines are parallel DBL_MAX is returned. If lines are the same 0 is returned.
It returns true if p is located inside the line or false otherwise.
Returns the minimum distance from any point of the line to the point p.
- intersects(line2, point[, epsilon=0.001])¶
If this and line2 intersect returns true and finds the intersection point p. Remember that lines perpendicular to the x axis are codified with slope = DBL_MAX and coef = x. Epsilon is the allowed difference between slopes to consider both lines parallel.
- intersectsPerpendicular(p_per, p_intersec)¶
Returns true if there is a perpendicular line to this one that ges by p_per. If so, the point in this line that is the intersection (p_intersec) is also calculated and returned.
- parallelLineAtDist(p1, p2, side, dist)¶
Given a vector in this line from p1 to p2, finds the parallel line at distance dist, either at the right (side = 0) or at the left side of the vector.
Returns the perpendicular line that goes by point. If this line is parallel to the x axis then the perpendicular that is returned is codified with slope = DBL_MAX and coef = point.x
Rotates this line modifying it using center as the rotation point and angle (value in radians) the angle of rotation. A positive angle will be a clokwise rotation (horaria) while a negative angle will be a counterclokwise rotation (anti-horaria).
Sets this line to be the one defined by these two points.