[Output]
  return normal vector as Vector3.
434408
def normal
      vec1 = self.vertices[1] - self.vertices[0]
      vec2 = self.vertices[2] - self.vertices[0]
      return (vec1.cross(vec2).normalize)
    end
464672
def norm_vec(vector):
    """"""
    assert len(vector) == 3
    v = np.array(vector)
    return v/np.sqrt(np.sum(v**2))
23237
def projection_as_vec_v3(v, w):
    
    proj_len = projection_v3(v, w)
    return scale_v3(v, proj_len)
1256457
def ave_list_v3(vec_list):
    """"""

    vec = Vec3(0, 0, 0)
    for v in vec_list:
        vec += v
    num_vecs = float(len(vec_list))
    vec = Vec3(vec.x / num_vecs, vec.y / num_vecs, vec.z / num_vecs)
    return vec
855483
def fromvector(cls, v):
        """"""
        w = v.normalized()
        return cls(w.x, w.y, w.z)
1181651
def get_trans(self, out_vec=None):
        

        if out_vec:
            return out_vec.set(*self.data[3][:3])

        return Vec3(*self.data[3][:3])
1363622
def normalized(self):
    

    norm = self.magnitude()
    return Vector(self.x / norm, self.y / norm, self.z / norm)
631798
def normalize(vector):
    '''
    '''
    d = sum(x * x for x in vector) ** 0.5
    return tuple(x / d for x in vector)
635127
function getter_THREE_Vector4(inst) {
	return [
		inst.x,
		inst.y,
		inst.z,
		inst.w];
}
1204488
function normalize(vec3) {
    if (vec3.x === 0 && vec3.y === 0 && vec3.z === 0) {
        return vec3;
    }
    const length = Math.sqrt(vec3.x * vec3.x + vec3.y * vec3.y + vec3.z * vec3.z);
    const invScalar = 1 / length;
    vec3.x *= invScalar;
    vec3.y *= invScalar;
    vec3.z *= invScalar;
    return vec3;
}
84636
def vertex_normals(vertices, faces):
    """"""

    def normalize_v3(arr):
        ''' Normalize a numpy array of 3 component vectors shape=(n,3) '''
        lens = np.sqrt(arr[:, 0]**2 + arr[:, 1]**2 + arr[:, 2]**2)
        arr /= lens[:, np.newaxis]

    tris = vertices[faces]
    facenorms = np.cross(tris[::, 1] - tris[::, 0], tris[::, 2] - tris[::, 0])
    normalize_v3(facenorms)

    norm = np.zeros(vertices.shape, dtype=vertices.dtype)
    norm[faces[:, 0]] += facenorms
    norm[faces[:, 1]] += facenorms
    norm[faces[:, 2]] += facenorms
    normalize_v3(norm)
    return norm
866376
def normal_h3(size: int = 10000) -> HistogramND:
    
    data1 = np.random.normal(0, 1, (size,))
    data2 = np.random.normal(0, 1, (size,))
    data3 = np.random.normal(0, 1, (size,))
    return h3([data1, data2, data3], name="normal", axis_names=tuple("xyz"), title="3D normal distribution")
128277
def orthogonal_vector(v):
    """"""
    if v[1] != 0 or v[2] != 0:
        c = (1, 0, 0)
    else:
        c = (0, 1, 0)
    return np.cross(v, c)
399161
def get_vectors(self, indices=None):
        ''''''
        H_ = self._deflated_solver.H
        (n_, n) = H_.shape
        coeffs = self.coeffs if indices is None else self.coeffs[:, indices]
        return numpy.c_[self._deflated_solver.V[:, :n],
                        self._deflated_solver.projection.U].dot(coeffs)
520439
def euclidean3d(v1, v2):
    """"""
    if not len(v1) == 3 and len(v2) == 3:
        print("Vectors are not in 3D space. Returning None.")
        return None
    return np.sqrt((v1[0] - v2[0]) ** 2 + (v1[1] - v2[1]) ** 2 + (v1[2] - v2[2]) ** 2)
1002022
def cross(self, vec):
        """"""
        if not isinstance(vec, Vector3Array):
            raise TypeError('Cross product operand must be a Vector3Array')
        if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV:
            raise ValueError('Cross product operands must have the same '
                             'number of elements.')
        return Vector3Array(np.cross(self, vec))
1118004
def norm(self) -> bk.BKTensor:
        """"""
        return bk.absolute(bk.inner(self.tensor, self.tensor))