All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.tsingjyujing.geo.basic.operations.IVector.scala Maven / Gradle / Ivy

There is a newer version: 2.8.9-2.11
Show newest version
package com.github.tsingjyujing.geo.basic.operations

/**
  * This vector is not same in Scala's `scala.collection.immutable.Vector`
  * it means a point in N-dimensional Euclid space
  *
  * @author [email protected]
  */
trait IVector extends Normable with Iterable[Double] {

    /**
      * Get norm of self object
      *
      * @param n order of the normal
      * @return
      */
    override def norm(n: Double): Double = math.pow(iterator.map(x => math.pow(x, n)).sum, 1.0 / n)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy