uqbar-math

A math extension for Scala with better abstractions to support complex algebraic expressions

License

License

GroupId

GroupId

org.uqbar
ArtifactId

ArtifactId

uqbar-math_2.11
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

uqbar-math
A math extension for Scala with better abstractions to support complex algebraic expressions
Project URL

Project URL

http://www.uqbar.org
Project Organization

Project Organization

Uqbar Foundation
Source Code Management

Source Code Management

https://github.com/uqbar-project/uqbar-math

Download uqbar-math_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/org.uqbar/uqbar-math_2.11/ -->
<dependency>
    <groupId>org.uqbar</groupId>
    <artifactId>uqbar-math_2.11</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.uqbar/uqbar-math_2.11/
implementation 'org.uqbar:uqbar-math_2.11:1.1.1'
// https://jarcasting.com/artifacts/org.uqbar/uqbar-math_2.11/
implementation ("org.uqbar:uqbar-math_2.11:1.1.1")
'org.uqbar:uqbar-math_2.11:jar:1.1.1'
<dependency org="org.uqbar" name="uqbar-math_2.11" rev="1.1.1">
  <artifact name="uqbar-math_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.uqbar', module='uqbar-math_2.11', version='1.1.1')
)
libraryDependencies += "org.uqbar" % "uqbar-math_2.11" % "1.1.1"
[org.uqbar/uqbar-math_2.11 "1.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.6

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar [2.2,)

Project Modules

There are no modules declared in this project.

uqbar-math Build Status

This library extends Scala in order to provide better abstractions to support complex algebraic expressions.

Setup

To include this library in your SBT project, just add the following line to your build.sbt file:

libraryDependencies += "org.uqbar" %% "uqbar-math" % "latest.integration"

Features

###Vector

Vectors are basic 2D structures which can be used to represent positions, translations or forces.

Two Vector implementations are provided:

  • Vector: Exposes all basic operations.
  • MutableVector: Extends Vector with mutable operations.

Note that Vector does NOT guarantee to be immutable, just doesn't expose the messages to be mutated. This is so to provide a more flexible approach, and allow mutable vector owners to expose them in a secure way. You can find out more about it here.

Implicit conversions to ease code writing are defined in org.uqbar.math.versors package.

import org.uqbar.math.vector._

val here: Vector = (1,5)                        // Vector converted from tuple
val there = here + (2.5,10)                     // Also a vector
val distance = here manhattanDistanceTo there

Contributions

Yes, please! Pull requests are always welcome, just try to keep it small and clean.

Version History

1.1

  • Added bidirectional AWT Point and Tuple implicit conversions.
  • Added Vector.random().
  • SBT refactor.
  • Fixed some vector bugs.

License

This code is open source software licensed under the LGPL v3 License by The Uqbar Foundation. Feel free to use it accordingly.

org.uqbar

Fundación Uqbar

Versions

Version
1.1.1