Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Necronomicron  
#1 Posted : 15 September 2021 16:22:58(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Hello!
I have an equation (sphere and cubic Bézier curve intersection points): B(t) ⋅ B(t) = r², where dot means vector dot product.
B(t) is a cubic Bézier curve:
B(t) = (1 − t)³ ⋅ P0 + 3t ⋅ (1 − t)² ⋅ P1 + 3t² ⋅ (1 − t) ⋅ P2 + t³ ⋅ P3, 0 ≤ t ≤ 1
P0, P1, P2, P3 are some known points, к is some known value too.
Is it possible to solve this using SMath while keeping constants as letters?

Edited by user 15 September 2021 17:51:55(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 15 September 2021 17:08:25(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Please attach your Smath document.
Bézier/Hermite ... lot in Smath.
Cheers ... Jean.
Offline Necronomicron  
#3 Posted : 15 September 2021 17:49:13(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Originally Posted by: Jean Giraud Go to Quoted Post
Please attach your Smath document.
Bézier/Hermite ... lot in Smath.
Cheers ... Jean.


https://ru.smath.com/cloud/sheet/ao2a4mLPSz
Well, not much in there, I don't know how to write the equation in it. I am new to SMath, and used only MathCAD a few times, like, 13-14 years ago...
Offline oscampo  
#4 Posted : 15 September 2021 18:19:37(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: Necronomicron Go to Quoted Post
Originally Posted by: Jean Giraud Go to Quoted Post
Please attach your Smath document.
Bézier/Hermite ... lot in Smath.
Cheers ... Jean.


https://ru.smath.com/cloud/sheet/ao2a4mLPSz
Well, not much in there, I don't know how to write the equation in it. I am new to SMath, and used only MathCAD a few times, like, 13-14 years ago...


"Error. There is no Worksheet found."

Please upload your sm file to any cloud service a share the link

Regards,

Oscar

Offline Necronomicron  
#5 Posted : 15 September 2021 18:24:03(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Sphere and cubic Bezier curve intersection points.sm (11kb) downloaded 10 time(s).
Originally Posted by: oscampo Go to Quoted Post
Originally Posted by: Necronomicron Go to Quoted Post
Originally Posted by: Jean Giraud Go to Quoted Post
Please attach your Smath document.
Bézier/Hermite ... lot in Smath.
Cheers ... Jean.


https://ru.smath.com/cloud/sheet/ao2a4mLPSz
Well, not much in there, I don't know how to write the equation in it. I am new to SMath, and used only MathCAD a few times, like, 13-14 years ago...


"Error. There is no Worksheet found."

Please upload your sm file to any cloud service a share the link

Regards,

Oscar



Sphere and cubic Bezier curve intersection points.sm (11kb) downloaded 10 time(s).

Edited by user 15 September 2021 18:26:53(UTC)  | Reason: Not specified

Offline oscampo  
#6 Posted : 15 September 2021 19:00:26(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: Necronomicron Go to Quoted Post
Please attach your Smath document.

Sphere and cubic Bezier curve intersection points.sm (11kb) downloaded 10 time(s).


You must use Symbolic evaluation to solve your equation, additionally, you can use some plugin for this task (in my case I used the Maxima plugin).
Please see attached file:

Sphere and Cubic.sm (216kb) downloaded 19 time(s).

Offline overlord  
#7 Posted : 15 September 2021 20:21:28(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
All those kind of symbolic solvings require either Maxima or Maple plugin as far as I know.
Every other smath solvers [solve(), roots(), FindRoot(), al_nleqsolve(), etc] are numerical solvers.
Could someone correct this statement if it is not true?

Regards

Edited by user 15 September 2021 20:42:03(UTC)  | Reason: Not specified

Offline oscampo  
#8 Posted : 15 September 2021 20:33:35(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: overlord Go to Quoted Post
All those kind of symbolic solvings require either Maxima or Maple plugin as far as I know.
Every other smath solvers [solve(), Roots(), al_nleqsolve(), etc] are numerical solvers.
Could someone correct this statement if it is not true?

Regards


yes, that's correct, you can check the description of solve(), roots(), al_nleqsolve(), etc on the Interactive SMath Handbook
Offline Razonar  
#9 Posted : 16 September 2021 02:57:18(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. In the attached how to solve the problem numerically. Notice that B(t) must to be defined using vectorize, because SMath don't expand the scalar by vector products.

Sphere and Cubic.sm (9kb) downloaded 6 time(s).
Clipboard01.jpg

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 16/09/2021(UTC)
Offline Necronomicron  
#10 Posted : 16 September 2021 12:43:49(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Originally Posted by: oscampo Go to Quoted Post
Originally Posted by: Necronomicron Go to Quoted Post
Please attach your Smath document.

Sphere and cubic Bezier curve intersection points.sm (11kb) downloaded 10 time(s).


You must use Symbolic evaluation to solve your equation, additionally, you can use some plugin for this task (in my case I used the Maxima plugin).
Please see attached file:

Sphere and Cubic.sm (216kb) downloaded 19 time(s).



There is missing «²» after second parentheses in your file. And I downloaded SMath and Maxima, but when I open your file, I get an error: «Cannot find maxima.bat».

Sphere and cubic Bezier curve intersection points.sm (4kb) downloaded 5 time(s).

Edited by user 16 September 2021 12:50:55(UTC)  | Reason: Not specified

Offline oscampo  
#11 Posted : 16 September 2021 13:33:52(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: Necronomicron Go to Quoted Post


...

There is missing «²» after second parentheses in your file. And I downloaded SMath and Maxima, but when I open your file, I get an error: «Cannot find maxima.bat».

Sphere and cubic Bezier curve intersection points.sm (4kb) downloaded 5 time(s).


Please refer to Maxima plugin instructions, you can find here
Offline Necronomicron  
#12 Posted : 16 September 2021 14:18:04(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Originally Posted by: oscampo Go to Quoted Post
Originally Posted by: Necronomicron Go to Quoted Post


...

There is missing «²» after second parentheses in your file. And I downloaded SMath and Maxima, but when I open your file, I get an error: «Cannot find maxima.bat».

Sphere and cubic Bezier curve intersection points.sm (4kb) downloaded 5 time(s).


Please refer to Maxima plugin instructions, you can find here


OK, I've fixed the error, but now it says: «r is undefined». Sorry, it's really hard to understand what to do and I can't find any proper docs about it...

Sphere and cubic Bezier curve intersection points.sm (5kb) downloaded 3 time(s).
Offline Necronomicron  
#13 Posted : 16 September 2021 14:43:30(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

I really don't get what's wrong now...

Sphere and cubic Bezier curve intersection points.sm (13kb) downloaded 13 time(s).
Offline oscampo  
#14 Posted : 16 September 2021 15:40:26(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: Necronomicron Go to Quoted Post
I really don't get what's wrong now...

Sphere and cubic Bezier curve intersection points.sm (13kb) downloaded 13 time(s).


There is a missing "*"
missing.png
Offline Necronomicron  
#15 Posted : 16 September 2021 17:07:40(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Originally Posted by: oscampo Go to Quoted Post
Originally Posted by: Necronomicron Go to Quoted Post
I really don't get what's wrong now...

Sphere and cubic Bezier curve intersection points.sm (13kb) downloaded 13 time(s).


There is a missing "*"
missing.png


Thank you! But what should I do with «r is undefined»? 🤔
Offline oscampo  
#16 Posted : 16 September 2021 17:12:25(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Are you sure you are using the option "Symbolic Optimization"?

You must right-click over your equation, then choose Optimization-Symbolic
Offline Necronomicron  
#17 Posted : 16 September 2021 17:40:06(UTC)
Necronomicron

Rank: Newbie

Groups: Registered
Joined: 15/09/2021(UTC)
Posts: 8
Belarus

Originally Posted by: oscampo Go to Quoted Post
Are you sure you are using the option "Symbolic Optimization"?

You must right-click over your equation, then choose Optimization-Symbolic


Thank you very much! It worked! However, the roots are so long... Not sure I can use them... Thanks anyway! 😊
Offline Razonar  
#18 Posted : 16 September 2021 20:52:16(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. Notice that P0, ..., P3 are vectors with 3 components, not scalars. You can't get the distance with B(t).B(t) using P's as scalars.

Best regards.
Alvaro.
Offline Jean Giraud  
#19 Posted : 17 September 2021 02:16:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Necronomicron Go to Quoted Post
I have an equation (sphere and cubic Bézier curve intersection points):

Didn't see the sphere ?
Bézier is a 2 D plot
I don't understand your project, will leave.
You can project Bézier as surface plot on the sphere,
at this point, all 'N' are roots.
Enjoy/ignore ... Jean.

Page6 Bezier.sm (31kb) downloaded 5 time(s).
Offline overlord  
#20 Posted : 17 September 2021 03:20:45(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Didn't see the sphere ?
Bézier is a 2 D plot
I don't understand your project, will leave.
You can project Bézier as surface plot on the sphere,
at this point, all 'N' are roots.
Enjoy/ignore ... Jean.

Not related with topic. Nice example to Bezier however no relation with question.
Seeing Bezier in question doesn't mean you can search your files and post your first match Bezier example.
thanks 1 user thanked overlord for this useful post.
on 17/09/2021(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.