# Sage for computer graphics?

Hi, I want to use Sage for visualizing curves, possibly 3d collision=intersection surfaces.. stuff like that. Is it suitable for that at all? For example, sage matrices sometimes require me to specify a "ring", I looked it up on wikipedia but there is no mention of the denotations "QQ" and "ZZ" that sage apparently uses. Can you help me understand these or point me to the right docs?

I will also need to do calculations with complex numbers and quaternions but I haven't found a library in sage that would do that. I'll give you a really practical example that I'm actually trying to do right now and this is the sort of thing that I want to do all the time: I have two quaternions, first I want to visualize them in 3d space. Then I want to draw a curve visualizing the function to interpolate between those two quaternions. For example, I want to see visually what spherical linear interpolation looks like in 3D, just like here:

Any pointers you can give me? Thank you in advance.

(can sage switch between column-major / row-major?)

edit retag close merge delete

Sort by » oldest newest most voted

A ring is a set with multiplication and addition, for example QQ = rational numbers and ZZ = integers.

You can construct quaternions as follows:

sage: i,j,k = QuaternionAlgebra(1,1).gens()
sage: j*k
-i

more