semantic name
This commit is contained in:
parent
d0771ef6dc
commit
9f71fa38a2
@ -12,18 +12,19 @@ zero_vector = Vector(0,0)
|
|||||||
def main() -> None:
|
def main() -> None:
|
||||||
print("Hello Teodora!")
|
print("Hello Teodora!")
|
||||||
|
|
||||||
distance = displacementVector(current_pos, target_pos)
|
displacement = displacementVector(current_pos, target_pos) # define function displacement
|
||||||
|
print(displacement)
|
||||||
|
|
||||||
|
distance = length(displacement) ## define function distance
|
||||||
print(distance)
|
print(distance)
|
||||||
|
|
||||||
lengthOfDistanceVector = length(distance)
|
direction = safe_normalize(displacement, 0.001) # define function safe normalisation
|
||||||
print(lengthOfDistanceVector)
|
|
||||||
|
|
||||||
direction = safe_normalize(distance, 0.001)
|
|
||||||
print(direction)
|
print(direction)
|
||||||
|
|
||||||
## calculate the displacement from current position to target position
|
|
||||||
|
|
||||||
|
|
||||||
|
## calculate the displacement from current position to target position
|
||||||
|
|
||||||
def displacementVector(current_pos, target_pos):
|
def displacementVector(current_pos, target_pos):
|
||||||
displacementVector = Vector(target_pos.x - current_pos.x, target_pos.y - current_pos.y)
|
displacementVector = Vector(target_pos.x - current_pos.x, target_pos.y - current_pos.y)
|
||||||
return displacementVector
|
return displacementVector
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user