Line intersections

Line intersections - An example of translation of a function from Matlab to Smath - Messages

#41 Posted: 2/19/2018 6:36:00 AM
MBe

MBe

2 likes in 21 posts.

Group: User

Hello Everybody,

Thanks to all of you for these extremely interesting postings.
I am barely able to fully understand them in depth... I need a bit of time to study them thoroughly.
Programming is like making music, and this is a symphony!!

Once again, thanks for all these good suggestions.

Marco
#42 Posted: 2/20/2018 1:08:59 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Still on line intersections.
Bug corrected: only lines with same number of points were accepted.
Now lines with different # of points will work.
Also some improvements in efficiency so that runtime is now
approx. -25%.



Marco, your Line Intersection is a piece of gold for Engineering works.
1. Trifolium
2. Dragilev implicit solve
3. Focus [suggested as next exercise]

Zillions thanks ... Jean

Maths InterX.r1 (2) Trifolium Copy.sm (103 KiB) downloaded 77 time(s).

#43 Posted: 2/21/2018 5:34:53 PM
Andrey Ivashov

Andrey Ivashov

2271 likes in 3734 posts.

Group: Super Administrator

Wrote

Just take a look at the speed:
plotG_2.PNG



Wrote

For such uses it would be good if the augment and stack functions could expand scalar arguments (or more generally any arguments not matching the maximum number of rows or cols) to uniformly populated vectors of the required size).



This is what I've got after improving stack/augment (see SMath Studio 0.99.6626):

plotg_improved_1.PNG

Note, that I had to make height of the result matrix about 40 times larger to see the same time! This means that this syntax of stack/augment is about 40 times faster then without it.

Thank you!
6 users liked this post
Radovan Omorjan 2/21/2018 6:38:00 PM, frapuano 2/21/2018 6:58:00 PM, sergio 2/21/2018 5:53:00 PM, Davide Carpi 2/22/2018 6:14:00 AM, MBe 2/22/2018 12:41:00 PM, NDTM Amarasekera 2/21/2018 11:06:00 PM
#44 Posted: 2/22/2018 12:55:14 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

This is what I've got after improving stack/augment (see SMath Studio 0.99.6626):


Looks great, not reproducible 6179.
Could it conflict in other situations ?

  • New Posts New Posts
  • No New Posts No New Posts