# Getting the length of a vector

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).

Getting the length of a vector

add a comment

1

You can use the `norm`

method:

```
sage: v = vector((3,4))
sage: v
(3, 4)
sage: v.norm()
5
```

Asked: **
2017-11-26 15:52:01 -0500
**

Seen: **1,758 times**

Last updated: **Nov 26 '17**

Internal Python: `No module named all`

location of sage -python executable

generate multiple Vars and vectors with these Vars

How to create a nonzero vector?

How does SageMath assign to a function call without raising an exception?

Sage cannot find user defined contains method

How can you stop warnings from printing?

Use system-wide installation of graphviz in sage?

from sage.all import * results in libcsage.so "cannot open shared object file" error

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.