Ask Your Question
0

Getting the length of a vector

asked 2017-11-26 15:52:01 -0600

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
1

answered 2017-11-26 15:59:43 -0600

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

Thank you a lot. Saved my life!

Poetastrophe gravatar imagePoetastrophe ( 2017-11-27 04:56:56 -0600 )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 15:52:01 -0600

Seen: 76 times

Last updated: Nov 26