summaryrefslogtreecommitdiff
path: root/src/main/scala/sims/util/Polar.scala
blob: 494c9840bd87bd7cc8e39f9eed175d6d175af322 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * Simple Mechanics Simulator (SiMS)
 * copyright (c) 2009 Jakob Odersky
 * made available under the MIT License
*/

package sims.util

import sims.geometry._
import scala.math._

/**Polar coordinates.*/
case class Polar(distance: Double, angle: Double) {
  
  /**Returns the vector representation of these polar coordinates.*/
  def toCarthesian = Vector2D(distance * sin(angle), distance * cos(angle))
}