OK, I wasn't sure if that was the intended way, since using tuples quickly 
leads to errors such as:

>>> a = ImageSet(Lambda(t, (t, t)), Interval(0, 1))
>>> a
ImageSet(Lambda(t, (t, t)), Interval(0, 1))
>>> (0,0) in a
True
>>> b = ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1))
>>> b
ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1))
>>> a.intersect(b)
Intersection(ImageSet(Lambda(t, (t, t)), Interval(0, 1)), 
ImageSet(Lambda(t, (1 - t, t)), Interval(0, 1)))
>>> simplify(a.intersect(b))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eward/se/sympy/simplify/simplify.py", line 582, in simplify
    return done(expr)
  File "/home/eward/se/sympy/simplify/simplify.py", line 541, in done
    rv = e.doit() if doit else e
  File "/home/eward/se/sympy/core/basic.py", line 1691, in doit
    for term in self.args]
  File "/home/eward/se/sympy/core/basic.py", line 1691, in <listcomp>
    for term in self.args]
  File "/home/eward/se/sympy/sets/fancysets.py", line 460, in doit
    return SetExpr(base_set)._eval_func(f).set
  File "/home/eward/se/sympy/sets/setexpr.py", line 84, in _eval_func
    res = set_function(func, self.set)
  File "/home/eward/se/sympy/sets/sets.py", line 2255, in set_function
    return _set_function(f, x)
  File "/home/eward/se/sympy/multipledispatch/dispatcher.py", line 198, in 
__call__
    return func(*args, **kwargs)
  File "/home/eward/se/sympy/sets/handlers/functions.py", line 70, in 
_set_function
    sing = [i for i in singularities(expr, var)
  File "/home/eward/se/sympy/calculus/singularities.py", line 83, in 
singularities
    if not expression.is_rational_function(symbol):
AttributeError: 'Tuple' object has no attribute 'is_rational_function'

On Tuesday, October 1, 2019 at 2:58:20 PM UTC-7, EKW wrote:
>
> For example if I wanted to represent the line segment from (0,0) to (1,1) 
> (f(t) = (t, t) for t in (0, 1))- can this be done with an image set? How? 
> Or a curve in 3d space (for example, f(t) = (t^2, t, 1 - t) for t in (0, 
> 1)).
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/9124ca80-5099-4f44-9441-f82af3f9de12%40googlegroups.com.

Reply via email to