gemgis.vector.calculate_angle
gemgis.vector.calculate_angle#
- gemgis.vector.calculate_angle(linestring: shapely.geometry.linestring.LineString) float #
Calculating the angle of a LineString to the vertical
- Parameters
linestring (shapely.geometry.linestring.LineString) – Shapely LineString consisting of two vertices, e.g.
linestring = LineString([(0, 0), (10, 10), (20, 20)])
- Returns
angle – Angle of a LineString to the vertical
- Return type
float
New in version 1.0.x.
Example
>>> # Loading Libraries and creating LineString >>> import gemgis as gg >>> from shapely.geometry import LineString >>> linestring = LineString([(0, 0), (20, 20)]) >>> linestring.wkt 'LINESTRING (0 0, 20 20)'
>>> # Calculating the strike angle of the LineString >>> angle = gg.vector.calculate_angle(linestring=linestring) >>> angle 135.0
See also
calculate_strike_direction_straight_linestring
Calculating the strike direction of a straight LineString
calculate_strike_direction_bent_linestring
Calculating the strike direction of a bent LineString
calculate_dipping_angle_linestring
Calculate the dipping angle of a LineString
calculate_dipping_angles_linestrings
Calculate the dipping angles of LineStrings
Note
The LineString must only consist of two points (start and end point)