summaryrefslogtreecommitdiff
path: root/src/sims/util/Polar.scala
blob: c4009b5fdc8394924a12f1311cd76c29015add18 (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))
}