Skip to content

Commit

Permalink
fix(position): remove duplicate getter
Browse files Browse the repository at this point in the history
  • Loading branch information
mwfarb committed Oct 28, 2024
1 parent 5ab005c commit 04db8b0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arena/attributes/position.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import math
from collections.abc import Iterable, Mapping

from ..utils import Utils
from .attribute import Attribute
from collections.abc import Iterable, Mapping


class Position(Attribute):
Expand Down Expand Up @@ -47,10 +48,4 @@ def to_str(self):
return Utils.tuple_to_string((self.x, self.y, self.z))

def distance_to(self, pos):
return math.sqrt(
(self.x - pos.x) ** 2 + (self.y - pos.y) ** 2 + (self.z - pos.z) ** 2
)

@property
def array(self):
return [self.x, self.y, self.z]
return math.sqrt((self.x - pos.x) ** 2 + (self.y - pos.y) ** 2 + (self.z - pos.z) ** 2)

0 comments on commit 04db8b0

Please # to comment.