|
| 1 | +diff --git a/sympy/geometry/point.py b/sympy/geometry/point.py |
| 2 | +index 73c20334d09e..ai0000000000 100644 |
| 3 | +--- a/sympy/geometry/point.py |
| 4 | ++++ b/sympy/geometry/point.py |
| 5 | +@@ -149,7 +149,7 @@ def __new__(cls, *args, **kwargs): |
| 6 | + if any(coords[dim:]): |
| 7 | + raise ValueError('Nonzero coordinates cannot be removed.') |
| 8 | +- if any(a.is_number and im(a) for a in coords): |
| 9 | ++ if evaluate and any(a.is_number and im(a) for a in coords): |
| 10 | + raise ValueError('Imaginary coordinates are not permitted.') |
| 11 | + if not all(isinstance(a, Expr) for a in coords): |
| 12 | + raise TypeError('Coordinates must be valid SymPy expressions.') |
| 13 | +diff --git a/sympy/geometry/tests/test_point.py b/sympy/geometry/tests/test_point.py |
| 14 | +index 930d707735e2..ai1111111111 100644 |
| 15 | +--- a/sympy/geometry/tests/test_point.py |
| 16 | ++++ b/sympy/geometry/tests/test_point.py |
| 17 | +@@ -1,5 +1,6 @@ |
| 18 | + from sympy.core.basic import Basic |
| 19 | + from sympy.core.numbers import (I, Rational, pi) |
| 20 | ++from sympy.core.parameters import evaluate |
| 21 | + from sympy.core.singleton import S |
| 22 | + from sympy.core.symbol import Symbol |
| 23 | + from sympy.core.sympify import sympify |
| 24 | +@@ -452,6 +453,12 @@ def test__normalize_dimension(): |
| 25 | + Point(1, 2, 0), Point(3, 4, 0)] |
| 26 | + |
| 27 | + |
| 28 | ++def test_issue_22684(): |
| 29 | ++ # Used to give an error |
| 30 | ++ with evaluate(False): |
| 31 | ++ Point(1, 2) |
| 32 | ++ |
| 33 | ++ |
| 34 | + def test_direction_cosine(): |
| 35 | + p1 = Point3D(0, 0, 0) |
| 36 | + p2 = Point3D(1, 1, 1) |
0 commit comments