Vector
Vectors class they are like segments, but with a given direction
Vector
Bases: Segment
, DirectedLinearEntity
Vector class to manipulate vector which can be seen as Segment with direction
Source code in otary/geometry/discrete/linear/directed/vector.py
cardinal_degree
property
Returns the cardinal degree of the vector in the cv2 space. We consider the top of the image to point toward the north as default and thus represent the cardinal degree value 0 mod 360.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
cardinal degree |
coordinates_shift
property
Return the vector as a single point (x1-x0, y1-y0)
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
coordinates shift |
normalized
property
Nornalized vector
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
normalized vector |
from_single_point(point)
classmethod
Get vector that goes from [0, 0] to point
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point
|
NDArray
|
point of shape 2 |
required |
Returns:
Name | Type | Description |
---|---|---|
Vector |
Vector
|
new vector object |
Source code in otary/geometry/discrete/linear/directed/vector.py
rescale_head(scale)
Rescale the head part of the vector without moving the first point. This method only updates the second point that composes the vector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scale
|
float
|
scale factor |
required |
Returns:
Name | Type | Description |
---|---|---|
Vector |
Vector
|
scaled vector |