The only difference is that this has a starting Point (p1) which represents the end of the Ray in that direction.
Parameters : | arg1 : point-like arg2 : {point-like, vector}
|
---|
Attributes
p1 | [point] Get the 1st Point that defines the Line. |
p2 | [point] Get the 2nd Point that defines the Line. |
phi | [scalar] Get self.v.phi. Convenience method. |
v | [vector] Get the Vector pointing from self.p1 to`self.p2`. |
Methods
__contains__(x) | Searches for x in “itself”. |
__getitem__(idx) | Get the points that define the Line by index. |
__len__() | The Line is made of 2 points so it’s length is 2.’ |
has(point) | Check if point is part of self. |
intersection(obj) | Tries to find the Point of intersection. |
is_line_like(obj) | Check if an object is in the form of Line-like for fast |
parallel_to(obj) | Find out if provided Vector or Line-like is |
perpendicular_to(obj) | Find out if provided Line is perpendicular to self. |
rotate(theta[, point, angle]) | Rotate self around pivot point. |
translate(dx, dy) | Translate self by given amounts on x and y. |
Detailed description
The only difference is that this has a starting Point (p1) which represents the end of the Ray in that direction.
Parameters : | arg1 : point-like arg2 : {point-like, vector}
|
---|
Searches for x in “itself”. If we’re talking about a Point or a Vector then this searches within their components (x, y). For everything else it searches within the list of points (vertices).
Parameters : | x : {point, scalar}
|
---|---|
Returns : | out : {True, False}
|
Get the points that define the Line by index.
Parameters : | idx : scalar
|
---|---|
Returns : | ret : point
|
Check if point is part of self.
Parameters : | point : point-like
|
---|---|
Returns : | ret : {True, False}
|
See also
Tries to find the Point of intersection.
The difference between this and the Line intersection method is that this has also the constrain that if the Point of intersection is on the line then it also must be within the bounds of the Ray.
Parameters : | obj : geometric object |
---|---|
Returns : | out : {gometric object, None}
|
See also
Check if an object is in the form of Line-like for fast computations (not necessary to build lines).
Parameters : | obj : anything |
---|---|
Returns : | res : {True, False} |
Find out if provided Vector or Line-like is parllel to self.
Parameters : | obj : {vector, line-like} |
---|---|
Returns : | ret : {True, False}
|
Find out if provided Line is perpendicular to self.
Returns : | ret : {True, False} |
---|
[scalar] Get self.v.phi. Convenience method.
Rotate self around pivot point.
Parameters : | theta : scalar
point : {point-like}, optional
angle : {‘degrees’, ‘radians’}, optional
|
---|
Translate self by given amounts on x and y.
Parameters : | dx, dy : scalar
|
---|
[Arnon1983] | Arnon et al., A Linear Time Algorithm for the Minimum Area Rectangle Enclosing a Convex Polygon” (1983), Computer Science Technical Reports. Paper 382 |
[WPolygon] | http://en.wikipedia.org/wiki/Polygon |