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 rana  
#1 Posted : 24 March 2018 18:36:32(UTC)
rana

Rank: Newbie

Groups: Registered
Joined: 24/03/2018(UTC)
Posts: 3
Location: Germany

Dear experts,

Sorry if this question is stupid, but I am new to SMATH.

In order to plot some simple vector diagrams (using the SMATH built in diagram) I did the following.
I want to plot the vector from a given start point with given length and angle.

So for the arrow I created a polygon, rotaded and moved it. This works quite well. I als can put the formulars into the plotting input area.

arrow1.png

But it would be nicer to define a function e.g. Arrow(start_x; start_y; length; angle).
Is this possible? What would be the syntax?

Is there maybe a smarter way of doing this?

Thanks in advance!
Ralf

arrow1.sm (12kb) downloaded 27 time(s).

Edited by user 24 March 2018 18:40:07(UTC)  | Reason: Not specified

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

Offline Davide Carpi  
#2 Posted : 24 March 2018 19:02:49(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hello Ralf,

welcome in the community Good

Simply put a function name on the LHS (left hand side) of the assignment operator

2018-03-24 16_56_50-SMath Studio - [arrow1.sm_].png
arrow1 (r1).sm (13kb) downloaded 48 time(s).

Once you have done it if you want to rename a variable inside the function you can do it at once using the F8 key when the text cursor is inside the variable you want to rename.

Edited by user 08 April 2018 13:54:05(UTC)  | Reason: marked as SOLVED

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 24/03/2018(UTC)
Offline Jean Giraud  
#3 Posted : 24 March 2018 23:30:48(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: rana Go to Quoted Post
I want to plot the vector from a given start point with given length and angle.


Gorgeous application of the 2D rotation matrix.
Few more in there.

Jean

Circle_rkfixed Arrow.sm (28kb) downloaded 55 time(s).
Users browsing this topic
Guest
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.