mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
e2e2a55480
commit
6337cf9aca
4
media.py
4
media.py
|
@ -158,19 +158,19 @@ def spoofGeolocation(baseDir: str,
|
||||||
(distanceFromCityCenter, angleRadians) = \
|
(distanceFromCityCenter, angleRadians) = \
|
||||||
_getCityPulse(currTimeAdjusted, doppelgangerSeed)
|
_getCityPulse(currTimeAdjusted, doppelgangerSeed)
|
||||||
# Get the position within the city, with some randomness added
|
# Get the position within the city, with some randomness added
|
||||||
fraction = randint(0, 100000) / 100000
|
|
||||||
latitude += \
|
latitude += \
|
||||||
distanceFromCityCenter * cityRadius * math.cos(angleRadians)
|
distanceFromCityCenter * cityRadius * math.cos(angleRadians)
|
||||||
# add a small amount of variance around the location
|
# add a small amount of variance around the location
|
||||||
|
fraction = randint(0, 100000) / 100000
|
||||||
latitude += (fraction * fraction * variance) - (variance / 2.0)
|
latitude += (fraction * fraction * variance) - (variance / 2.0)
|
||||||
# gps locations aren't transcendental, so round to a fixed
|
# gps locations aren't transcendental, so round to a fixed
|
||||||
# number of decimal places
|
# number of decimal places
|
||||||
latitude = int(latitude * 10000) / 10000.0
|
latitude = int(latitude * 10000) / 10000.0
|
||||||
|
|
||||||
fraction = randint(0, 100000) / 100000
|
|
||||||
longitude += \
|
longitude += \
|
||||||
distanceFromCityCenter * cityRadius * math.sin(angleRadians)
|
distanceFromCityCenter * cityRadius * math.sin(angleRadians)
|
||||||
# add a small amount of variance around the location
|
# add a small amount of variance around the location
|
||||||
|
fraction = randint(0, 100000) / 100000
|
||||||
longitude += (fraction * fraction * variance) - (variance / 2.0)
|
longitude += (fraction * fraction * variance) - (variance / 2.0)
|
||||||
# gps locations aren't transcendental, so round to a fixed
|
# gps locations aren't transcendental, so round to a fixed
|
||||||
# number of decimal places
|
# number of decimal places
|
||||||
|
|
Loading…
Reference in New Issue