Ask Your Question
1

Getting the length of a vector

asked 2017-11-26 22:52:01 +0100

Poetastrophe gravatar image

Is there a way to get the length of a vector according to the form: For a vector (v_1,v_2,v_3, ... , v_n), get the result sqrt(v_1^2 + v_2^2 + v_3^2 + ... + v_n^2).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-11-26 22:59:43 +0100

tmonteil gravatar image

You can use the norm method:

sage: v = vector((3,4))
sage: v
(3, 4)
sage: v.norm()
5
edit flag offensive delete link more

Comments

1

Thank you a lot. Saved my life!

Poetastrophe gravatar imagePoetastrophe ( 2017-11-27 11:56:56 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-11-26 22:52:01 +0100

Seen: 6,229 times

Last updated: Nov 26 '17