@@ -23,15 +23,15 @@ data class Vec2d(val x: Double, val y: Double) {
2323 constructor (x: Float , y: Float ) : this (x.toDouble(), y.toDouble())
2424 constructor (x: Int , y: Int ) : this (x.toDouble(), y.toDouble())
2525
26- operator fun unaryMinus (): Vec2d = Vec2d (- x, - y)
26+ operator fun unaryMinus () = Vec2d (- x, - y)
2727
2828 fun plus (x : Double , y : Double ) = Vec2d (this .x + x, this .y + y)
2929 infix operator fun plus (other : Vec2d ) = plus(other.x, other.y)
3030 infix operator fun plus (other : Double ) = plus(other, other)
3131 infix operator fun plus (other : Float ): Vec2d = plus(other.toDouble(), other.toDouble())
3232 infix operator fun plus (other : Int ): Vec2d = plus(other.toDouble(), other.toDouble())
3333
34- fun minus (x : Double , y : Double )= Vec2d (this .x + x, this .y + y)
34+ fun minus (x : Double , y : Double ) = Vec2d (this .x - x, this .y - y)
3535 infix operator fun minus (other : Vec2d ): Vec2d = minus(other.x, other.y)
3636 infix operator fun minus (other : Double ): Vec2d = minus(other, other)
3737 infix operator fun minus (other : Float ): Vec2d = minus(other.toDouble(), other.toDouble())
@@ -49,7 +49,7 @@ data class Vec2d(val x: Double, val y: Double) {
4949 infix operator fun div (other : Float ): Vec2d = div(other.toDouble(), other.toDouble())
5050 infix operator fun div (other : Int ): Vec2d = div(other.toDouble(), other.toDouble())
5151
52- fun roundToInt (): Vec2d = Vec2d (this . x.roundToInt(), this . y.roundToInt())
52+ fun roundToInt () = Vec2d (x.roundToInt(), y.roundToInt())
5353
5454 companion object {
5555 val ZERO = Vec2d (0.0 , 0.0 )
0 commit comments