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

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

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

/**
  * Which can get angle between this to T (use rad as unit)
  * Commonly, we use classOf[this] as T for symmetry
  *
  * @author [email protected]
  * @tparam T Type of the object to compare
  */
trait Angleable[T] {
    /**
      * Get cosed angle value of this and x
      *
      * @param x compare unit
      * @return
      */
    def conAngle(x: T): Double

    /**
      * Get angle (in unit of rad) value of this and x
      *
      * @param x compare unit
      * @return
      */
    def angle(x: T): Double = math.acos(conAngle(x))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy