On Fri, Feb 10, 2012 at 2:42 AM, Laereom <jamesdbo...@gmail.com> wrote:
> So, I'm trying to get into the most basic use of sympy for a nested
> path processor in a project I'm working on.  Currently, I'm just
> attempting to get it to solve a 3 dimensional distance equation for
> one formula.  Here's how it goes:
>
>    def path_processor(self,origin,destination):
>        sym_x, sym_y = symbols('x,y')
>        z = origin['z']
>
>        dest_x = destination['x']
>        dest_y = destination['y']
>        dest_z = destination['z']
>        #This should give us a line.
>        solve( math.sqrt( (sym_x-dest_x)**2 + (sym_y-dest_y)**2 + (z-
> dest_z)**2 ))
>
> Running this code gives me the error, "Symbolic value, can't compute"
> from sympy's core expression library.  Now, honestly, when I made

I think the error is because you are using math.sqrt on a symbolic
expression. sympy has it's own sqrt.

The docstring of solve is quite extensive and should get you started.
Also, which variable are you trying to solve for? Do you want the
distance to be zero (you didn't set your sqrt(...) equal to anything)?
Does destination contain things like {x:a} or {"x":a} or is `a` an
actual number?

/c

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to