Here you can find the source of length(long[] v)
Parameter | Description |
---|---|
v | the vector (Long) |
public static double length(long[] v)
//package com.java2s; public class Main { /**/*from w w w .java 2 s .c o m*/ * Returns the length of a vector * * @param v the vector (Long) * @return the length of the vector (Double) */ public static double length(long[] v) { return Math.sqrt(v[0] * v[0] + v[1] * v[1]); } /** * Returns the length of a vector * * @param v the vector (Float) * @return the length of the vector (Float) */ public static float length(float[] v) { return (float) Math.sqrt(v[0] * v[0] + v[1] * v[1]); } /** * Returns the length of a vector * * @param v the vector (Integer) * @return the length of the vector (Float) */ public static float length(int[] v) { return (float) Math.sqrt(v[0] * v[0] + v[1] * v[1]); } }