Created package and relative imports

This commit is contained in:
Pascal Serrarens 2025-03-31 08:57:44 +02:00
parent a11338ac1d
commit 73dd05ca0f
8 changed files with 12 additions and 12 deletions

View File

@ -3,7 +3,7 @@
# file, You can obtain one at https ://mozilla.org/MPL/2.0/. # file, You can obtain one at https ://mozilla.org/MPL/2.0/.
import math import math
from Float import * from .Float import *
# This is in fact AngleSingle # This is in fact AngleSingle
class Angle: class Angle:

View File

@ -1,6 +1,6 @@
import math import math
from Angle import Angle from .Angle import Angle
from Vector import Vector3 from .Vector import Vector3
class Direction: class Direction:
"""! A direction using angles """! A direction using angles

View File

@ -1,8 +1,8 @@
import math import math
from Vector import Vector3 from .Vector import Vector3
from Angle import Angle from .Angle import Angle
from Direction import Direction from .Direction import Direction
Deg2Rad = (math.pi * 2) / 360 Deg2Rad = (math.pi * 2) / 360

View File

@ -1,6 +1,6 @@
import math import math
from Direction import * from .Direction import *
from Vector import * from .Vector import *
class Polar: class Polar:
"""! A polar 2D vector """! A polar 2D vector

View File

@ -1,5 +1,5 @@
from Direction import * from .Direction import *
from Quaternion import * from .Quaternion import *
class SwingTwist: class SwingTwist:
"""A rotation using swing and twist angle components""" """A rotation using swing and twist angle components"""

View File

@ -1,6 +1,6 @@
import math import math
from Angle import * from .Angle import *
epsilon = 1E-05 epsilon = 1E-05

0
__init__.py Normal file
View File

View File

@ -316,7 +316,7 @@ class SphericalTest(unittest.TestCase):
v2 = Spherical.Degrees(1, 45, 0) v2 = Spherical.Degrees(1, 45, 0)
r = v1 - v2 r = v1 - v2
assert(r == Spherical(3, 45, 0)) assert(r == Spherical.Degrees(3, 45, 0))
v2 = Spherical.Degrees(1, -135, 0) v2 = Spherical.Degrees(1, -135, 0)
r = v1 - v2 r = v1 - v2