libpysal.cg.get_angle_between

libpysal.cg.get_angle_between(ray1, ray2)[source]

Returns the angle formed between a pair of rays which share an origin.

Parameters:
ray1libpysal.cg.Ray

A ray forming the beginning of the angle measured.

ray2libpysal.cg.Ray

A ray forming the end of the angle measured.

Returns:
anglefloat

The angle between ray1 and ray2.

Raises:
ValueError

Raised when rays do not have the same origin.

Examples

>>> get_angle_between(
...     Ray(Point((0, 0)), Point((1, 0))),
...     Ray(Point((0, 0)), Point((1, 0)))
... )
0.0