Geometry#
- class wattson.analysis.visualization.power_grid.geometry.Geometry#
Bases:
object
Methods
Calculates a point on the line from a towards b, where offset defines the absolute distance from a.
Sums two vectors
center
degrees
distance
length
Normalizes the vector such that its length is 1.
Calculates a point on the line between a and b, where offset defines the distance from a in relation to the length of the line between a and b.
radians
rotate
rotate_90_degrees
Scales the vector by the given scalar
Subtracts b from a (i.e., a - b)
vectorize_angle
Returns the vector between origin and target, i.e., shifts the line between origin and target to (0, 0).
- static abs_point_on_line(a, b, abs_offset)#
Calculates a point on the line from a towards b, where offset defines the absolute distance from a.
- Parameters:
a –
b –
abs_offset –
- static add(a, b)#
Sums two vectors
- Parameters:
a –
b –
- static normalize(vector)#
Normalizes the vector such that its length is 1.
- Parameters:
vector –
- static point_on_line(a, b, offset)#
Calculates a point on the line between a and b, where offset defines the distance from a in relation to the length of the line between a and b. With offset=0.5, the center point is returned, offset=0 returns a and offset=1 returns b
- Parameters:
a –
b –
offset –
- static scale(vector, scalar)#
Scales the vector by the given scalar
- Parameters:
vector –
scalar –
- static subtract(a, b)#
Subtracts b from a (i.e., a - b)
- Parameters:
a –
b –
- static vectorize_line(origin, target)#
Returns the vector between origin and target, i.e., shifts the line between origin and target to (0, 0).
- Parameters:
origin –
target –