Fix random heading function, randomize wind better (#1619)

* Fix random heading function, randomize wind better

* Use 359 as max default for random heading, for uniform distribution
This commit is contained in:
Magnus Wolffelt
2021-09-16 12:29:00 +02:00
committed by GitHub
parent 90ca619839
commit 3e6d63e8f7
2 changed files with 9 additions and 7 deletions

View File

@@ -224,7 +224,7 @@ class Heading:
return cls(Heading.reduce_angle(deg))
@classmethod
def random(cls, min_angle: int = 0, max_angle: int = 0) -> Heading:
def random(cls, min_angle: int = 0, max_angle: int = 359) -> Heading:
return Heading.from_degrees(random.randint(min_angle, max_angle))
def __add__(self, other: Heading) -> Heading: