Getting There

So the first iteration is nearing completion. You can get a copy of it by clicking here. Most of the functionality is there, but I do not guarantee that it will all work perfectly yet. There isn't a lot missing besides for a couple of things in polygon/triangle, along with some missing ellipse intersections (besides for ellipse/line intersection). You can give it a try, but there is no document describing how to use it right now. The layout of code is very similar, but not the same, as the UML Diagram I created before starting.

If anyone decides to give it a try, give me some feedback on the interface and how easy it is to use, some suggestions you would make, some errors you encountered, and your own test cases that fail. All feedback will be greatly appreciated. One of the things I didn't plan on doing but may work on later is reporting to the user what conditions will make something True. For example, if the user asks if the points (1, 1), (2, 2) and (x1, x2) are collinear, there is no way to tell. Right now the system will return False, but why not be a bit more informative and return some structure, or raise some exception saying that it would be True if x1=x2. Maple works this way.

There's still a fair bit of work to do, but at least a "proof of concept" implementation is in place. The set of test cases I've been using are also available if someone wants to look at them for ideas on how to use the code.

7 comments:

Anonymous said...

Hi Jason. I think you are doing an outstanding job with this.

The only thing i'm not sure of is the class Vector, since we already have the class Matrix and it can work as a vector, so i was wondering if it would work in your module doing the job of Vector...

Jason G said...

Thanks Fabian. I too was wondering about the Vector class. As you probably noticed, it was only a very simple helper class used in Ellipse. I can probably use the Matrix class since the only thing I'm really doing is a dot product.

Heck, I can probably get away with using none of them, which is what I think I will actually do.

Unknown said...

Hi, I just tried your package and it works great!

If you want, let's commit it into the sympy's svn repository.

What kind of arguments are you passing to GeometryEntity._simplify()? Shouldn't all of them be a subclasses of Basic?


Ondrej

Jason G said...

I'm going to clue up the few pieces of missing functionality today, or as much of it as I can, and then commit it.

As for GeometryEntity._simplify, I was debating whether or not I wanted to allow Python primitives (int, float, etc) in there. What I'm thinking about doing is checking for this in __init__ and then converting arguments to Rational/Real if they are int/float. Then I can get rid of _simplify() and just use sympy.modules.simplify.simplify() without worry in its place.

Jason G said...

I had other things to take care of tonight, so I'm going to put off the initial commit until tomorrow.

Unknown said...

I see. You can use Basic.sympify() - see it's docstring. That should do exactly what you need.

Jason G said...

Thanks ondrej, I was going to look into that and see how you guys were doing it right now. I converted all of my constructors so that they use Basic.sympify now.