angle¶
-
sisl.utils.angle(s, rad=True, in_rad=True)[source]¶ Convert the input string to an angle, either radians or degrees.
Parameters: s : str
If
sstarts with ‘r’ it is interpreted as radians[0:2pi]. Ifsstarts with ‘a’ it is interpreted as a regular angle[0:360]. Ifsends with ‘r’ it returns in radians. Ifsends with ‘a’ it returns in regular angle.smay be any mathematical equation which can be intercepted througheval.rad : bool, optional
Whether the returned angle is in radians. Note than an ‘r’ at the end of
shas precedence.in_rad : bool, optional
Whether the calculated angle is in radians. Note than an ‘r’ at the beginning of
shas precedence.Returns: float
the angle in the requested unit