[sage-devel] Re: Useful methods for graphics objects

2022-08-25 Thread Kwankyu Lee
On Friday, August 26, 2022 at 2:57:15 AM UTC+9 Nils Bruin wrote:

> On Thursday, 25 August 2022 at 07:23:41 UTC-7 Kwankyu Lee wrote:
>
>> 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.
>>
>
> That sounds like the model that geogebra uses.
>

Yes. It would be a programming interface of the model.

I do think that having a graphical interface such as geogebra has is really 
> a plus for these applications, though, 
>

No intention to compete with geogebra with a graphical interface. 

Rather it would be a competition as like latex vs word. Really tikz does 
that in the latex world. But sage could have some functionality of tikz, 
working directly with sage graphics objects.
 

> In my experience, the tweaking of graphics for publication is what takes 
> by far the most time, so the more interface for that the better. 
>

Yes. We can view it as a way to tweak the graphics objects to get the 
matplotlib object we want. For example, we can easily draw a pentagon in 
sage, but tweaking the pentagon using the edges and vertices of the 
pentagon seems difficult. 

 

-- 
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/937e039c-cbd5-4430-86a2-fc5ea754b6d8n%40googlegroups.com.


[sage-devel] Re: Useful methods for graphics objects

2022-08-25 Thread Nils Bruin
On Thursday, 25 August 2022 at 07:23:41 UTC-7 Kwankyu Lee wrote:

> 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.
>

That sounds like the model that geogebra uses. Geogebra is immensely useful 
for teaching and simple illustrations especially because it's 
point-and-click and it's designed with basically the level of first year 
calculus in mind. Plus it can export to very efficient tikz, which makes it 
easy to make point-and-click pictures and still have things mathematically 
accurate (for instance, points can "snap" to nearby graphical objects, 
including graphs of functions.

It could be interesting to have "constructive geometry" objects in python 
(sympy?) or sage, but I suspect that should start as separate objects from 
graphics objects to start with (although you could try subclassing). I do 
think that having a graphical interface such as geogebra has is really a 
plus for these applications, though, so I have some doubts on whether you'd 
be able to successfully compete with it.

Personally, I think the graphics objects in sage should primarily be such 
that it is very easy to get at the underlying mathplotlib objects. In my 
experience, the tweaking of graphics for publication is what takes by far 
the most time, so the more interface for that the better. Matplotlib has a 
lot of use documentation, and examples, so being able to apply the 
knowledge obtained from there helps.
 

-- 
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/50751c75-6488-40ff-848d-80bf5c5d04d6n%40googlegroups.com.


[sage-devel] Re: Useful methods for graphics objects

2022-08-25 Thread Kwankyu Lee
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.


Re: [sage-devel] Re: 9.7.beta8 build error jupyter_jsmol

2022-08-25 Thread Dima Pasechnik
On Thu, Aug 25, 2022 at 9:46 AM Kazuyoshi Furutaka
 wrote:
>
> Logs in my failed case (at work).

Thanks. Meanwhile, the fix is on https://trac.sagemath.org/ticket/34421
- positively reviewed.

> Kazuyoshi
>
> 2022年8月25日(木) 12:52 Kazuyoshi Furutaka :
>>
>> It also happened to me on one of my system (fedora 36).
>>
>> After removing yarnpkg rpm, it builds ok.
>>
>> (will post the log later...)
>> Kazuyoshi
>>
>>
>> 2022年8月25日(木) 1:28 Samuel Lelievre :
>>>
>>> Now tracked at
>>>
>>> - Sage Trac ticket #34421
>>>   Fix timeout in jupyter_jsmol installation
>>>   https://trac.sagemath.org/ticket/34421
>>>
>>> (thanks Dima for opening the ticket).
>>>
>>> --
>>> 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/672129d6-7530-4fec-9d8a-7fecaad378een%40googlegroups.com.
>
>
>
> --
> Kazuyoshi Furutaka
>
> --
> 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/CANjERve_Qj7To8FUaW2-0K13XGO8rPNDybkOzV91KkzCHnZqVA%40mail.gmail.com.

-- 
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/CAAWYfq3sCTx22KLoaxLxWpLrSUv0peA0c8b%3DmASKp2bWDG%2BUJw%40mail.gmail.com.


[sage-devel] Re: Useful methods for graphics objects

2022-08-25 Thread Eric Gourgoulhon
Le mercredi 24 août 2022 à 03:14:22 UTC+2, Kwankyu Lee a écrit :

> It is embarrassing that  an idea of attaching ".length()" method to a line 
> segment graphics object leads to SageManifolds. We don't need vectors and 
> inner products to compute the length of a line segment.


I agree that it sounds daunting to speak about pseudo-Riemannian manifolds 
for just computing the length of a line segment, but note that, by working 
at the EuclideanSpace level, the end user does not need to know anything 
about the underlying manifold machinery.  See for instance this tutorial: 
https://doc.sagemath.org/html/en/thematic_tutorials/vector_calculus.html

The only complication would be to add the extra line
sage: E = EuclideanSpace(3)
at the beginning of the code For instance, your example at the start of 
this thread would become

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

Eric. 
 

-- 
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/e8e1cb6a-2fca-4947-afbf-3ed7a1220396n%40googlegroups.com.


[sage-devel] Re: Useful methods for graphics objects

2022-08-25 Thread Eric Gourgoulhon
Hi, 

Le mercredi 24 août 2022 à 02:18:06 UTC+2, Travis Scrimshaw a écrit :

> In general, I think we are best leaving the drawing classes to just 
> drawing as a separations-of-concerns. 
>

+1
IMHO, line2d and line3d should not be considered as mathematical objects 
(segmented lines in some Euclidean space), but rather as pure graphical 
objects.
 

> It sounds like we need better integration between our algebraic 
> objects/implementations and the drawing/plotting tools. This might include 
> more plot_* functions or specialized mixin-/sub-classes for small 
> dimensional (sub)spaces. Likewise we might want to add some general tools 
> for inner product spaces, such as "ind_closest_point() or 
> shortest_distance(), with an assumption of course that we can do calculus 
> on the vector space.
>

+1
 

>
> As an alternative, if we want to think of objects specifically living in 
> Euclidean space, we have the EuclideanSpace(n) for this with specialized 
> subclasses for 2d and 3d. Perhaps we should implement some of the features 
> you want using objects there, such as line (segment) as a subclass of the 
> curve? For piecewise differentiable curves, this might require some more 
> programming.
>
> Éric, what do you think about adding such things to SageManifolds? Could 
> this be feasible?
>
>
This certainly should be feasible. As you point out, one should introduce a 
subclass of curves for segmented lines in Eudlidean spaces and define a 
length() method for them. More generally, one should introduce a length() 
method for any piecewise differentiable curve in a pseudo-Riemannian 
manifold. This is not implemented yet and certainly should be added to the 
todo list. 

Best regards, 

  Eric.

-- 
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/b551bb01-e95c-4dba-8228-def7f39b3c12n%40googlegroups.com.


[sage-devel] Re: AlphabeticStrings()

2022-08-25 Thread 'Travis Scrimshaw' via sage-devel
Hi Doris,
   What would their images be in this monoid? Their capital letter versions 
are not generators of the monoid. If you would like to work in a different 
(free) monoid, then you would need to implement it (not necessarily within 
Sage). If you just want to extend the encoding, say have ß -> SS and ü -> 
U, then you are probably best writing your own encoding function to handle 
these additional cases.

Best,
Travis


On Thursday, August 25, 2022 at 3:28:52 PM UTC+9 dantetante wrote:

> Hi list,
>
> this
>
> A=AlphabeticStrings()
> s='hellowörld'
> A.encoding(s)
>
> is throwing an error. Is there any possibility of enlarging the alphabet 
> set by some chosen characters like german ü, ä, ö, ß?
> I understand that it makes no sense to enlarge to the whole ASCII 
> character set in *this* case, but I really would appreciate to have german 
> umlauts.
>
>
> Thanks in advance ...
>
> Doris
>
>
>

-- 
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/536f7a35-0cb7-4e3c-8452-2edb4c874e08n%40googlegroups.com.


[sage-devel] AlphabeticStrings()

2022-08-25 Thread 'Doris Behrendt' via sage-devel
Hi list,

this

A=AlphabeticStrings()
s='hellowörld'
A.encoding(s)

is throwing an error. Is there any possibility of enlarging the alphabet set by 
some chosen characters like german ü, ä, ö, ß?
I understand that it makes no sense to enlarge to the whole ASCII character set 
in *this* case, but I really would appreciate to have german umlauts.


Thanks in advance ...

Doris


-- 
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/DCADD4EC-5A9F-42DA-AAF8-0C2783B67C31%40me.com.