Compare commits
No commits in common. "f58dd8816f059fb72dd430ae21982c051e669f46" and "ea38bdaa502f18cad20e8cdc938158ca03d11fbd" have entirely different histories.
f58dd8816f
...
ea38bdaa50
1 changed files with 6 additions and 7 deletions
|
@ -8,7 +8,7 @@ WIND_SPEED_MAX = 140 # knots
|
||||||
WIND_SPEED_MIN = 10
|
WIND_SPEED_MIN = 10
|
||||||
WIND_SPEED_STEP = 10
|
WIND_SPEED_STEP = 10
|
||||||
|
|
||||||
WIND_DIR_STEP = 30 # degrees
|
WIND_DIR_STEP = 45 # degrees
|
||||||
|
|
||||||
def radians(degrees: float) -> float:
|
def radians(degrees: float) -> float:
|
||||||
return (degrees + 90) * (math.pi / 180.0)
|
return (degrees + 90) * (math.pi / 180.0)
|
||||||
|
@ -108,13 +108,12 @@ class Hodograph():
|
||||||
text = "%dkt" % speed
|
text = "%dkt" % speed
|
||||||
extents = cr.text_extents(text)
|
extents = cr.text_extents(text)
|
||||||
|
|
||||||
for angle in (0, 180):
|
sx, sy = self.sample_to_screen(speed, 180)
|
||||||
sx, sy = self.sample_to_screen(speed, angle)
|
|
||||||
|
|
||||||
cr.move_to(x + sx + extents.width * 0.25,
|
cr.move_to(x + sx + extents.width * 0.25,
|
||||||
y + sy - extents.height * 1.5)
|
y + sy - extents.height * 1.5)
|
||||||
cr.show_text(text)
|
cr.show_text(text)
|
||||||
cr.stroke()
|
cr.stroke()
|
||||||
|
|
||||||
cr.restore()
|
cr.restore()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue