# Copyright (C) 2021 Open Source Robotics Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
import math
from ignition.math import Vector2d
from ignition.math import Vector2f


class TestVector2(unittest.TestCase):

    def test_construction(self):
        v = Vector2d()
        self.assertAlmostEqual(0.0, v.x())
        self.assertAlmostEqual(0.0, v.y())

        vec = Vector2d(1, 0)
        self.assertEqual(vec.x(), 1)
        self.assertEqual(vec.y(), 0)

        vec2 = Vector2d(vec)
        self.assertEqual(vec2, vec)

        # Copy
        vec3 = vec
        self.assertEqual(vec3, vec)

        # Inequality
        vec4 = Vector2d()
        self.assertNotEqual(vec, vec4)

    def test_vector2(self):
        v = Vector2d(1, 2)

        # Distance
        self.assertAlmostEqual(2.236, v.distance(Vector2d()), delta=1e-2)

        # Normalize
        v.normalize()
        self.assertTrue(v.equal(Vector2d(0.447214, 0.894427), 1e-4))

        # Set
        v.set(4, 5)
        self.assertTrue(v.equal(Vector2d(4, 5), 1e-4))

        # Abs
        v.set(-1, -2)
        self.assertTrue(v.abs().equal(Vector2d(1, 2), 1e-4))

        # _eq_
        v = Vector2d(6, 7)
        self.assertTrue(v.equal(Vector2d(6, 7), 1e-4))

        # _add_
        v = v + Vector2d(1, 2)
        self.assertTrue(v.equal(Vector2d(7, 9), 1e-4))

        v += Vector2d(5, 6)
        self.assertTrue(v.equal(Vector2d(12, 15), 1e-4))

        # __sub__
        v = v - Vector2d(2, 4)
        self.assertTrue(v.equal(Vector2d(10, 11), 1e-4))

        v.set(2, 4)
        v -= Vector2d(1, 6)
        self.assertTrue(v.equal(Vector2d(1, -2), 1e-4))

        # __truediv__
        v.set(10, 6)
        v = v / Vector2d(2, 3)
        self.assertTrue(v.equal(Vector2d(5, 2), 1e-4))

        v.set(10, 6)
        v /= Vector2d(2, 3)
        self.assertTrue(v.equal(Vector2d(5, 2), 1e-4))

        # __truediv__ int
        v.set(10, 6)
        v = v / 2
        self.assertTrue(v.equal(Vector2d(5, 3), 1e-4))

        v.set(10, 6)
        v /= 2
        self.assertTrue(v.equal(Vector2d(5, 3), 1e-4))

        # __mul__
        v.set(10, 6)
        v = v * Vector2d(2, 4)
        self.assertTrue(v.equal(Vector2d(20, 24), 1e-4))

        v.set(10, 6)
        v *= Vector2d(2, 4)
        self.assertTrue(v.equal(Vector2d(20, 24), 1e-4))

        # __mul__ int
        v.set(10, 6)
        v = v * 2
        self.assertTrue(v.equal(Vector2d(20, 12), 1e-4))

        v.set(10, 6)
        v *= 2
        self.assertTrue(v.equal(Vector2d(20, 12), 1e-4))

        # is_finite
        self.assertTrue(v.is_finite())

    def test_max(self):
        vec1 = Vector2d(0.1, 0.2)
        vec2 = Vector2d(0.3, 0.5)
        vec3 = Vector2d(0.4, 0.2)

        self.assertAlmostEqual(vec1.max(), 0.2)
        self.assertAlmostEqual(vec3.max(), 0.4)

        vec1.max(vec2)
        self.assertAlmostEqual(vec1, Vector2d(0.3, 0.5))

        vec1.max(vec3)
        self.assertAlmostEqual(vec1, Vector2d(0.4, 0.5))

    def test_min(self):
        vec1 = Vector2d(0.3, 0.5)
        vec2 = Vector2d(0.1, 0.2)
        vec3 = Vector2d(0.05, 0.1)

        self.assertAlmostEqual(vec1.min(), 0.3)
        self.assertAlmostEqual(vec3.min(), 0.05)

        vec1.min(vec2)
        self.assertAlmostEqual(vec1, Vector2d(0.1, 0.2))

        vec1.min(vec3)
        self.assertAlmostEqual(vec1, Vector2d(0.05, 0.1))

    def test_equal_tolerance(self):
        # Test Equal function with specified tolerance
        self.assertFalse(Vector2d.ZERO.equal(Vector2d.ONE, 1e-6))
        self.assertFalse(Vector2d.ZERO.equal(Vector2d.ONE, 1e-3))
        self.assertFalse(Vector2d.ZERO.equal(Vector2d.ONE, 1e-1))
        self.assertTrue(Vector2d.ZERO.equal(Vector2d.ONE, 1))
        self.assertTrue(Vector2d.ZERO.equal(Vector2d.ONE, 1.1))

    def test_dot(self):
        v = Vector2d(1, 2)
        self.assertAlmostEqual(v.dot(Vector2d(3, 4)), 11.0)
        self.assertAlmostEqual(v.dot(Vector2d(0, 0)), 0.0)
        self.assertAlmostEqual(v.dot(Vector2d(1, 0)), 1.0)
        self.assertAlmostEqual(v.dot(Vector2d(0, 1)), 2.0)

    def test_correct(self):
        vec1 = Vector2d(0, float("nan"))
        vec2 = Vector2d(float("inf"), -1)
        vec3 = Vector2d(10, -2)

        vec1.correct()
        vec2.correct()
        vec3.correct()

        self.assertAlmostEqual(vec1, Vector2d(0, 0))
        self.assertAlmostEqual(vec2, Vector2d(0, -1))
        self.assertAlmostEqual(vec3, Vector2d(10, -2))

    def test_abs_dot(self):
        v = Vector2d(1, -2)

        self.assertAlmostEqual(v.abs_dot(Vector2d(3, 4)), 11.0)
        self.assertAlmostEqual(v.abs_dot(Vector2d(0, 0)), 0.0)
        self.assertAlmostEqual(v.abs_dot(Vector2d(1, 0)), 1.0)
        self.assertAlmostEqual(v.abs_dot(Vector2d(0, 1)), 2.0)

    def test_add(self):
        vec1 = Vector2d(0.1, 0.2)
        vec2 = Vector2d(1.1, 2.2)

        vec3 = vec1
        vec3 += vec2

        self.assertAlmostEqual(vec1 + vec2, Vector2d(1.2, 2.4))
        self.assertAlmostEqual(vec3, Vector2d(1.2, 2.4))

        # Add zero
        # Scalar right
        self.assertEqual(vec1 + 0, vec1)

        # Vector left and right
        self.assertAlmostEqual(Vector2d.ZERO + vec1, vec1)
        self.assertAlmostEqual(vec1 + Vector2d.ZERO, vec1)

        # Addition assigment
        vec4 = Vector2d(vec1)
        vec4 += 0
        self.assertEqual(vec4, vec1)
        vec4 += Vector2d.ZERO
        self.assertAlmostEqual(vec4, vec1)

        # Add non-trivial scalar values left and right
        self.assertEqual(vec1 + 2.5, Vector2d(2.6, 2.7))

        vec1 = vec4
        vec4 += 2.5
        self.assertEqual(vec4, Vector2d(2.6, 2.7))

    def test_sub(self):
        vec1 = Vector2d(0.1, 0.2)
        vec2 = Vector2d(1.1, 2.2)

        vec3 = vec2
        vec3 -= vec1

        self.assertAlmostEqual(vec2 - vec1, Vector2d(1.0, 2.0))
        self.assertAlmostEqual(vec3, Vector2d(1.0, 2.0))

        # Subtraction with zeros
        # Scalar right
        self.assertEqual(vec1 - 0, vec1)

        # Vector left and right
        self.assertAlmostEqual(Vector2d.ZERO - vec1, -vec1)
        self.assertAlmostEqual(vec1 - Vector2d.ZERO, vec1)

        # Subtraction assignment
        vec4 = Vector2d(vec1)
        vec4 -= 0
        self.assertEqual(vec4, vec1)
        vec4 -= Vector2d.ZERO
        self.assertAlmostEqual(vec4, vec1)

        # Subtract non-trivial scalar values left and right
        self.assertEqual(vec1 - 2.5, -Vector2d(2.4, 2.3))

        vec4 = vec1
        vec4 -= 2.5
        self.assertEqual(vec4, -Vector2d(2.4, 2.3))

    def test_multiply(self):
        v = Vector2d(0.1, -4.2)

        vec2 = v * 2.0
        self.assertEqual(vec2, Vector2d(0.2, -8.4))

        vec2 *= 4.0
        self.assertEqual(vec2, Vector2d(0.8, -33.6))

        # Multiply by zero
        # Scalar right
        self.assertEqual(v * 0, Vector2d.ZERO)

        # Element-wise vector multiplication
        self.assertEqual(v * Vector2d.ZERO, Vector2d.ZERO)

        # Multiply by one
        # Scalar right
        self.assertEqual(v * 1, v)

        # Element-wise vector multiplication
        self.assertEqual(v * Vector2d.ONE, v)

        # Multiply by non-trivial scalar value
        scalar = 2.5
        expect = Vector2d(0.25, -10.5)
        self.assertEqual(v * scalar, expect)

        # Multiply by itself element-wise
        v.set(0.1, 0.5)
        self.assertAlmostEqual(v * v, Vector2d(0.01, 0.25))

    def test_lenght(self):
        # Zero vector
        self.assertAlmostEqual(Vector2d.ZERO.length(), 0.0)
        self.assertAlmostEqual(Vector2d.ZERO.squared_length(), 0.0)

        # One vector
        self.assertAlmostEqual(Vector2d.ONE.length(),
                               math.sqrt(2), delta=1e-10)
        self.assertAlmostEqual(Vector2d.ONE.squared_length(), 2.0)

        # Arbitrary vector
        v = Vector2d(0.1, -4.2)
        self.assertAlmostEqual(v.length(), 4.20119030752, delta=1e-10)
        self.assertAlmostEqual(v.squared_length(), 17.65)

        # Integer vector
        v = Vector2d(3, 4)
        self.assertAlmostEqual(v.length(), 5)
        self.assertAlmostEqual(v.squared_length(), 25)

    def test_nan(self):
        nanVec = Vector2d.NAN
        self.assertFalse(nanVec.is_finite())
        self.assertTrue(math.isnan(nanVec.x()))
        self.assertTrue(math.isnan(nanVec.y()))

        nanVec.correct()
        self.assertEqual(Vector2d.ZERO, nanVec)
        self.assertTrue(nanVec.is_finite())

        nanVecF = Vector2f.NAN
        self.assertFalse(nanVecF.is_finite())
        self.assertTrue(math.isnan(nanVecF.x()))
        self.assertTrue(math.isnan(nanVecF.y()))

        nanVecF.correct()
        self.assertEqual(Vector2f.ZERO, nanVecF)
        self.assertTrue(nanVecF.is_finite())

if __name__ == '__main__':
    unittest.main()

[((9317, 9332), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9330, 9332), False, 'import unittest\n'), ((786, 796), 'ignition.math.Vector2d', 'Vector2d', ([], {}), '()\n', (794, 796), False, 'from ignition.math import Vector2d\n'), ((898, 912), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(0)'], {}), '(1, 0)\n', (906, 912), False, 'from ignition.math import Vector2d\n'), ((1003, 1016), 'ignition.math.Vector2d', 'Vector2d', (['vec'], {}), '(vec)\n', (1011, 1016), False, 'from ignition.math import Vector2d\n'), ((1161, 1171), 'ignition.math.Vector2d', 'Vector2d', ([], {}), '()\n', (1169, 1171), False, 'from ignition.math import Vector2d\n'), ((1252, 1266), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(2)'], {}), '(1, 2)\n', (1260, 1266), False, 'from ignition.math import Vector2d\n'), ((1689, 1703), 'ignition.math.Vector2d', 'Vector2d', (['(6)', '(7)'], {}), '(6, 7)\n', (1697, 1703), False, 'from ignition.math import Vector2d\n'), ((1876, 1890), 'ignition.math.Vector2d', 'Vector2d', (['(5)', '(6)'], {}), '(5, 6)\n', (1884, 1890), False, 'from ignition.math import Vector2d\n'), ((2089, 2103), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(6)'], {}), '(1, 6)\n', (2097, 2103), False, 'from ignition.math import Vector2d\n'), ((2325, 2339), 'ignition.math.Vector2d', 'Vector2d', (['(2)', '(3)'], {}), '(2, 3)\n', (2333, 2339), False, 'from ignition.math import Vector2d\n'), ((2771, 2785), 'ignition.math.Vector2d', 'Vector2d', (['(2)', '(4)'], {}), '(2, 4)\n', (2779, 2785), False, 'from ignition.math import Vector2d\n'), ((3156, 3174), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(0.2)'], {}), '(0.1, 0.2)\n', (3164, 3174), False, 'from ignition.math import Vector2d\n'), ((3190, 3208), 'ignition.math.Vector2d', 'Vector2d', (['(0.3)', '(0.5)'], {}), '(0.3, 0.5)\n', (3198, 3208), False, 'from ignition.math import Vector2d\n'), ((3224, 3242), 'ignition.math.Vector2d', 'Vector2d', (['(0.4)', '(0.2)'], {}), '(0.4, 0.2)\n', (3232, 3242), False, 'from ignition.math import Vector2d\n'), ((3542, 3560), 'ignition.math.Vector2d', 'Vector2d', (['(0.3)', '(0.5)'], {}), '(0.3, 0.5)\n', (3550, 3560), False, 'from ignition.math import Vector2d\n'), ((3576, 3594), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(0.2)'], {}), '(0.1, 0.2)\n', (3584, 3594), False, 'from ignition.math import Vector2d\n'), ((3610, 3629), 'ignition.math.Vector2d', 'Vector2d', (['(0.05)', '(0.1)'], {}), '(0.05, 0.1)\n', (3618, 3629), False, 'from ignition.math import Vector2d\n'), ((4344, 4358), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(2)'], {}), '(1, 2)\n', (4352, 4358), False, 'from ignition.math import Vector2d\n'), ((4723, 4739), 'ignition.math.Vector2d', 'Vector2d', (['(10)', '(-2)'], {}), '(10, -2)\n', (4731, 4739), False, 'from ignition.math import Vector2d\n'), ((5014, 5029), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(-2)'], {}), '(1, -2)\n', (5022, 5029), False, 'from ignition.math import Vector2d\n'), ((5324, 5342), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(0.2)'], {}), '(0.1, 0.2)\n', (5332, 5342), False, 'from ignition.math import Vector2d\n'), ((5358, 5376), 'ignition.math.Vector2d', 'Vector2d', (['(1.1)', '(2.2)'], {}), '(1.1, 2.2)\n', (5366, 5376), False, 'from ignition.math import Vector2d\n'), ((5821, 5835), 'ignition.math.Vector2d', 'Vector2d', (['vec1'], {}), '(vec1)\n', (5829, 5835), False, 'from ignition.math import Vector2d\n'), ((6209, 6227), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(0.2)'], {}), '(0.1, 0.2)\n', (6217, 6227), False, 'from ignition.math import Vector2d\n'), ((6243, 6261), 'ignition.math.Vector2d', 'Vector2d', (['(1.1)', '(2.2)'], {}), '(1.1, 2.2)\n', (6251, 6261), False, 'from ignition.math import Vector2d\n'), ((6725, 6739), 'ignition.math.Vector2d', 'Vector2d', (['vec1'], {}), '(vec1)\n', (6733, 6739), False, 'from ignition.math import Vector2d\n'), ((7122, 7141), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(-4.2)'], {}), '(0.1, -4.2)\n', (7130, 7141), False, 'from ignition.math import Vector2d\n'), ((7758, 7779), 'ignition.math.Vector2d', 'Vector2d', (['(0.25)', '(-10.5)'], {}), '(0.25, -10.5)\n', (7766, 7779), False, 'from ignition.math import Vector2d\n'), ((8371, 8390), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(-4.2)'], {}), '(0.1, -4.2)\n', (8379, 8390), False, 'from ignition.math import Vector2d\n'), ((8558, 8572), 'ignition.math.Vector2d', 'Vector2d', (['(3)', '(4)'], {}), '(3, 4)\n', (8566, 8572), False, 'from ignition.math import Vector2d\n'), ((1792, 1806), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(2)'], {}), '(1, 2)\n', (1800, 1806), False, 'from ignition.math import Vector2d\n'), ((1983, 1997), 'ignition.math.Vector2d', 'Vector2d', (['(2)', '(4)'], {}), '(2, 4)\n', (1991, 1997), False, 'from ignition.math import Vector2d\n'), ((2220, 2234), 'ignition.math.Vector2d', 'Vector2d', (['(2)', '(3)'], {}), '(2, 3)\n', (2228, 2234), False, 'from ignition.math import Vector2d\n'), ((2664, 2678), 'ignition.math.Vector2d', 'Vector2d', (['(2)', '(4)'], {}), '(2, 4)\n', (2672, 2678), False, 'from ignition.math import Vector2d\n'), ((3401, 3419), 'ignition.math.Vector2d', 'Vector2d', (['(0.3)', '(0.5)'], {}), '(0.3, 0.5)\n', (3409, 3419), False, 'from ignition.math import Vector2d\n'), ((3482, 3500), 'ignition.math.Vector2d', 'Vector2d', (['(0.4)', '(0.5)'], {}), '(0.4, 0.5)\n', (3490, 3500), False, 'from ignition.math import Vector2d\n'), ((3789, 3807), 'ignition.math.Vector2d', 'Vector2d', (['(0.1)', '(0.2)'], {}), '(0.1, 0.2)\n', (3797, 3807), False, 'from ignition.math import Vector2d\n'), ((3870, 3889), 'ignition.math.Vector2d', 'Vector2d', (['(0.05)', '(0.1)'], {}), '(0.05, 0.1)\n', (3878, 3889), False, 'from ignition.math import Vector2d\n'), ((4008, 4048), 'ignition.math.Vector2d.ZERO.equal', 'Vector2d.ZERO.equal', (['Vector2d.ONE', '(1e-06)'], {}), '(Vector2d.ONE, 1e-06)\n', (4027, 4048), False, 'from ignition.math import Vector2d\n'), ((4074, 4114), 'ignition.math.Vector2d.ZERO.equal', 'Vector2d.ZERO.equal', (['Vector2d.ONE', '(0.001)'], {}), '(Vector2d.ONE, 0.001)\n', (4093, 4114), False, 'from ignition.math import Vector2d\n'), ((4140, 4178), 'ignition.math.Vector2d.ZERO.equal', 'Vector2d.ZERO.equal', (['Vector2d.ONE', '(0.1)'], {}), '(Vector2d.ONE, 0.1)\n', (4159, 4178), False, 'from ignition.math import Vector2d\n'), ((4205, 4241), 'ignition.math.Vector2d.ZERO.equal', 'Vector2d.ZERO.equal', (['Vector2d.ONE', '(1)'], {}), '(Vector2d.ONE, 1)\n', (4224, 4241), False, 'from ignition.math import Vector2d\n'), ((4267, 4305), 'ignition.math.Vector2d.ZERO.equal', 'Vector2d.ZERO.equal', (['Vector2d.ONE', '(1.1)'], {}), '(Vector2d.ONE, 1.1)\n', (4286, 4305), False, 'from ignition.math import Vector2d\n'), ((4848, 4862), 'ignition.math.Vector2d', 'Vector2d', (['(0)', '(0)'], {}), '(0, 0)\n', (4856, 4862), False, 'from ignition.math import Vector2d\n'), ((4901, 4916), 'ignition.math.Vector2d', 'Vector2d', (['(0)', '(-1)'], {}), '(0, -1)\n', (4909, 4916), False, 'from ignition.math import Vector2d\n'), ((4955, 4971), 'ignition.math.Vector2d', 'Vector2d', (['(10)', '(-2)'], {}), '(10, -2)\n', (4963, 4971), False, 'from ignition.math import Vector2d\n'), ((5464, 5482), 'ignition.math.Vector2d', 'Vector2d', (['(1.2)', '(2.4)'], {}), '(1.2, 2.4)\n', (5472, 5482), False, 'from ignition.math import Vector2d\n'), ((5521, 5539), 'ignition.math.Vector2d', 'Vector2d', (['(1.2)', '(2.4)'], {}), '(1.2, 2.4)\n', (5529, 5539), False, 'from ignition.math import Vector2d\n'), ((6057, 6075), 'ignition.math.Vector2d', 'Vector2d', (['(2.6)', '(2.7)'], {}), '(2.6, 2.7)\n', (6065, 6075), False, 'from ignition.math import Vector2d\n'), ((6149, 6167), 'ignition.math.Vector2d', 'Vector2d', (['(2.6)', '(2.7)'], {}), '(2.6, 2.7)\n', (6157, 6167), False, 'from ignition.math import Vector2d\n'), ((6349, 6367), 'ignition.math.Vector2d', 'Vector2d', (['(1.0)', '(2.0)'], {}), '(1.0, 2.0)\n', (6357, 6367), False, 'from ignition.math import Vector2d\n'), ((6406, 6424), 'ignition.math.Vector2d', 'Vector2d', (['(1.0)', '(2.0)'], {}), '(1.0, 2.0)\n', (6414, 6424), False, 'from ignition.math import Vector2d\n'), ((7197, 7216), 'ignition.math.Vector2d', 'Vector2d', (['(0.2)', '(-8.4)'], {}), '(0.2, -8.4)\n', (7205, 7216), False, 'from ignition.math import Vector2d\n'), ((7270, 7290), 'ignition.math.Vector2d', 'Vector2d', (['(0.8)', '(-33.6)'], {}), '(0.8, -33.6)\n', (7278, 7290), False, 'from ignition.math import Vector2d\n'), ((7930, 7950), 'ignition.math.Vector2d', 'Vector2d', (['(0.01)', '(0.25)'], {}), '(0.01, 0.25)\n', (7938, 7950), False, 'from ignition.math import Vector2d\n'), ((8033, 8055), 'ignition.math.Vector2d.ZERO.length', 'Vector2d.ZERO.length', ([], {}), '()\n', (8053, 8055), False, 'from ignition.math import Vector2d\n'), ((8093, 8123), 'ignition.math.Vector2d.ZERO.squared_length', 'Vector2d.ZERO.squared_length', ([], {}), '()\n', (8121, 8123), False, 'from ignition.math import Vector2d\n'), ((8183, 8204), 'ignition.math.Vector2d.ONE.length', 'Vector2d.ONE.length', ([], {}), '()\n', (8202, 8204), False, 'from ignition.math import Vector2d\n'), ((8237, 8249), 'math.sqrt', 'math.sqrt', (['(2)'], {}), '(2)\n', (8246, 8249), False, 'import math\n'), ((8295, 8324), 'ignition.math.Vector2d.ONE.squared_length', 'Vector2d.ONE.squared_length', ([], {}), '()\n', (8322, 8324), False, 'from ignition.math import Vector2d\n'), ((1336, 1346), 'ignition.math.Vector2d', 'Vector2d', ([], {}), '()\n', (1344, 1346), False, 'from ignition.math import Vector2d\n'), ((1436, 1464), 'ignition.math.Vector2d', 'Vector2d', (['(0.447214)', '(0.894427)'], {}), '(0.447214, 0.894427)\n', (1444, 1464), False, 'from ignition.math import Vector2d\n'), ((1540, 1554), 'ignition.math.Vector2d', 'Vector2d', (['(4)', '(5)'], {}), '(4, 5)\n', (1548, 1554), False, 'from ignition.math import Vector2d\n'), ((1638, 1652), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(2)'], {}), '(1, 2)\n', (1646, 1652), False, 'from ignition.math import Vector2d\n'), ((1736, 1750), 'ignition.math.Vector2d', 'Vector2d', (['(6)', '(7)'], {}), '(6, 7)\n', (1744, 1750), False, 'from ignition.math import Vector2d\n'), ((1839, 1853), 'ignition.math.Vector2d', 'Vector2d', (['(7)', '(9)'], {}), '(7, 9)\n', (1847, 1853), False, 'from ignition.math import Vector2d\n'), ((1923, 1939), 'ignition.math.Vector2d', 'Vector2d', (['(12)', '(15)'], {}), '(12, 15)\n', (1931, 1939), False, 'from ignition.math import Vector2d\n'), ((2030, 2046), 'ignition.math.Vector2d', 'Vector2d', (['(10)', '(11)'], {}), '(10, 11)\n', (2038, 2046), False, 'from ignition.math import Vector2d\n'), ((2136, 2151), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(-2)'], {}), '(1, -2)\n', (2144, 2151), False, 'from ignition.math import Vector2d\n'), ((2267, 2281), 'ignition.math.Vector2d', 'Vector2d', (['(5)', '(2)'], {}), '(5, 2)\n', (2275, 2281), False, 'from ignition.math import Vector2d\n'), ((2372, 2386), 'ignition.math.Vector2d', 'Vector2d', (['(5)', '(2)'], {}), '(5, 2)\n', (2380, 2386), False, 'from ignition.math import Vector2d\n'), ((2493, 2507), 'ignition.math.Vector2d', 'Vector2d', (['(5)', '(3)'], {}), '(5, 3)\n', (2501, 2507), False, 'from ignition.math import Vector2d\n'), ((2585, 2599), 'ignition.math.Vector2d', 'Vector2d', (['(5)', '(3)'], {}), '(5, 3)\n', (2593, 2599), False, 'from ignition.math import Vector2d\n'), ((2711, 2727), 'ignition.math.Vector2d', 'Vector2d', (['(20)', '(24)'], {}), '(20, 24)\n', (2719, 2727), False, 'from ignition.math import Vector2d\n'), ((2818, 2834), 'ignition.math.Vector2d', 'Vector2d', (['(20)', '(24)'], {}), '(20, 24)\n', (2826, 2834), False, 'from ignition.math import Vector2d\n'), ((2937, 2953), 'ignition.math.Vector2d', 'Vector2d', (['(20)', '(12)'], {}), '(20, 12)\n', (2945, 2953), False, 'from ignition.math import Vector2d\n'), ((3031, 3047), 'ignition.math.Vector2d', 'Vector2d', (['(20)', '(12)'], {}), '(20, 12)\n', (3039, 3047), False, 'from ignition.math import Vector2d\n'), ((4396, 4410), 'ignition.math.Vector2d', 'Vector2d', (['(3)', '(4)'], {}), '(3, 4)\n', (4404, 4410), False, 'from ignition.math import Vector2d\n'), ((4456, 4470), 'ignition.math.Vector2d', 'Vector2d', (['(0)', '(0)'], {}), '(0, 0)\n', (4464, 4470), False, 'from ignition.math import Vector2d\n'), ((4515, 4529), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(0)'], {}), '(1, 0)\n', (4523, 4529), False, 'from ignition.math import Vector2d\n'), ((4574, 4588), 'ignition.math.Vector2d', 'Vector2d', (['(0)', '(1)'], {}), '(0, 1)\n', (4582, 4588), False, 'from ignition.math import Vector2d\n'), ((5072, 5086), 'ignition.math.Vector2d', 'Vector2d', (['(3)', '(4)'], {}), '(3, 4)\n', (5080, 5086), False, 'from ignition.math import Vector2d\n'), ((5136, 5150), 'ignition.math.Vector2d', 'Vector2d', (['(0)', '(0)'], {}), '(0, 0)\n', (5144, 5150), False, 'from ignition.math import Vector2d\n'), ((5199, 5213), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(0)'], {}), '(1, 0)\n', (5207, 5213), False, 'from ignition.math import Vector2d\n'), ((5262, 5276), 'ignition.math.Vector2d', 'Vector2d', (['(0)', '(1)'], {}), '(0, 1)\n', (5270, 5276), False, 'from ignition.math import Vector2d\n'), ((6967, 6985), 'ignition.math.Vector2d', 'Vector2d', (['(2.4)', '(2.3)'], {}), '(2.4, 2.3)\n', (6975, 6985), False, 'from ignition.math import Vector2d\n'), ((7060, 7078), 'ignition.math.Vector2d', 'Vector2d', (['(2.4)', '(2.3)'], {}), '(2.4, 2.3)\n', (7068, 7078), False, 'from ignition.math import Vector2d\n')]