Add polar coordinate calculations to ContextGraph
This commit is contained in:
parent
e2f37553df
commit
a340fe7936
|
|
@ -1872,6 +1872,10 @@ class ContextGraph:
|
||||||
r_last = self._r.value # type: ignore
|
r_last = self._r.value # type: ignore
|
||||||
theta = next(self._theta) # type: ignore
|
theta = next(self._theta) # type: ignore
|
||||||
r = self._r.value # type: ignore
|
r = self._r.value # type: ignore
|
||||||
|
x_last = r_last * math.cos(theta_last)
|
||||||
|
y_last = r_last * math.sin(theta_last)
|
||||||
|
x = r * math.cos(theta)
|
||||||
|
y = r * math.sin(theta)
|
||||||
return x_last, y_last, x, y, self.color
|
return x_last, y_last, x, y, self.color
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue