getTheta method
Returns the theta of this segment in radians. 0 means vector to the right side --> Since positive values in y-direction points towards the bottom of the screen the angle runs clockwise. see https://de.wikipedia.org/wiki/Arkustangens_und_Arkuskotangens#/media/Datei:Arctangent.svg
Implementation
double getTheta() {
if (_theta != null) return _theta!;
if (end == start) return 0;
_theta = end.x != start.x
? atan((end.y - start.y) / (end.x - start.x))
: end.y > end.x
? pi / 2
: -pi / 2;
return _theta!;
}