struct Vector { var x: Decimal; var y: Decimal; func magnitude(this): Decimal { return Math.sqrt(this.x * this.x + this.y * this.y); } }