Skip to content

Standard mathematical operations implemented through type extensions and infix functions

License

Notifications You must be signed in to change notification settings

vincent-pradeilles/euler-kotlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Euler Kotlin

This project is a partial port to Kotlin of the features available in the Euler created by Mattt. The features that were not ported are already defined by the Kotlin standard library.

Euler Kotlin is library that implements most of the standard mathematical operation not already provided by the Kotlin standard library.

While Kotlin does not support custom operators, it does, however, provide two very powerful mechanisms that this library relies on: the ability to extend non-nominal types (e.g. typealiases) and the support of infix functions.


Arithmetic

  • infix fun Int.divides(other: Int): Boolean - Divides
  • infix fun Int.doesNotDevide(other: Int): Boolean - Does Not Divide

Calculus

Functions

  • infix fun <T> Function<T>.composeWith(other: Function<T>): Function<T> - Composition

Vectors

  • infix fun Array<Number>.dotProduct(other: Array<Number>): Number - Dot Product
  • infix fun Vector3D.crossProduct(other: Vector3D): Vector3D - Cross Product
  • val Array<Number>.norm: Number - Vector Norm
  • infix fun Array<Number>.angleWith(other: Array<Number>): Number - Angle Between Vectors

License

MIT

Contact

Vincent Pradeilles (@v_pradeilles)

About

Standard mathematical operations implemented through type extensions and infix functions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages