Let me expand the example a bit.

We are given two points. We draw a line segment connecting the two points. 
Then we want to draw a circle with a diameter the line segment.

Certainly we need to compute the center and the radius of the circle. The 
standard way to do this with Sage is, as Travis described, to do some 
vector calculus.

But an intuitive way (or an object-oriented way ?) is to get the necessary 
information from the line segment. Thus if L is the line segment, I do p = 
L.mid_point(); r = L.length() / 2. Then circle(p, r) will do the work.

On Thursday, August 25, 2022 at 5:55:21 PM UTC+9 Eric Gourgoulhon wrote:

> sage: E = EuclideanSpace(3)
> sage: L = E.line([(1,2,3),(2,2,3)])  # not implemented yet
> sage: L.length()
>

For the above example,  we create the line L and the circle C in 
EuclideanSpace(2). Then we do L.draw() + C.draw(). This is an interesting 
idea. But this would make graphics module a dependency of Euclidean space 
module.

By the way, the purpose of my original post is to ask whether providing the 
facility for the intuitive way of drawing (algorithmic drawing or 
object-oriented drawing, to invent a fancy term) is worth while or just 
waste of energy...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/528b98a0-c39b-4638-ac31-a044476d3db1n%40googlegroups.com.

Reply via email to