My opinion was that it does not make sense to calculate anything
between 3D and 2D points, as they live in different spaces. However
there should be a way to promote 2D point to 3D like the following:

>>> plane = ... # some object representing a 2D plane in 3D space
>>> point = ... # some 2d point
>>> point3D = promote_to_3D(point, plane)
# taking `point`, assuming that it is on `plane` and
# returning the corresponding 3D point

There can be a default plane (x,y,z=0)

There should also be a way to project a 3d point on a plane or a line.



We could do it in the Plane class as you above described but that would
also require a lot of if instance statements in the plane class as well  as
we have to check whether a point is 2D or 3D and act accordingly.

So according to me there is no way of compromising these if else statements
as they will come in one class or the other.



On Sat, May 24, 2014 at 2:49 AM, Stefan Krastanov <[email protected]
> wrote:

> > The reason for the classes to be tightly coupled was to enable such
> > computations
> >  a = Point3D(1,2,3)
> >  a.distance(Point(2,3)) This returns the distance between these two
> points.
> > This is one of the possible four combinations(as in distance between 2 3D
> > points, 2 2D points, 3D and 2D point)
> >
> > So i have a question
> > 1) Should the above code work as in should it give the result (sqrt(11))
> in
> > the above case or should it raise an nonimplement error as they are 2
> > different classes(3D and 2D)
>
> My opinion was that it does not make sense to calculate anything
> between 3D and 2D points, as they live in different spaces. However
> there should be a way to promote 2D point to 3D like the following:
>
> >>> plane = ... # some object representing a 2D plane in 3D space
> >>> point = ... # some 2d point
> >>> point3D = promote_to_3D(point, plane)
> # taking `point`, assuming that it is on `plane` and
> # returning the corresponding 3D point
>
> There can be a default plane (x,y,z=0)
>
> There should also be a way to project a 3d point on a plane or a line.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sympy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sympy/hqHC-9cA9UM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAD8szLygrQUCGMPgWxpAJe50KSSB4RAq2di0jurkSYrRkaj6fA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAC_H1WFwtAi6Thgm4qvzNnOc1BJebxhu9%3DLkoVHCFUBHYHOAKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to