Created
October 24, 2016 12:27
-
-
Save sr229/7cbe744f02c6c73b2e43b2ce265924dd to your computer and use it in GitHub Desktop.
just another try to do a TypeScript Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Just another retarded TypeScript made by a lazy twat | |
* just to learn the lang itself | |
* and to donate something for /r/LoveLive | |
* | |
* Yes, it's Licensed under MIT too. | |
*/ | |
const strings = input.split(""); | |
class Vector { | |
constructor( | |
public x: number, | |
public y: number, | |
public z: number | |
) { } | |
static times(k: number, v: Vector) { return new Vector(k * v.x, k * v.y, k * v.z); } | |
static minus(v1: Vector, v2: Vector) { return new Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); } | |
static plus(v1: Vector, v2: Vector) { return new Vector(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); } | |
static dot(v1: Vector, v2: Vector) { return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; } | |
static mag(v: Vector) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); } | |
static norm(v: Vector) { | |
var mag = Vector.mag(v); | |
var div = (mag === 0) ? Infinity : 1.0 / mag; | |
return Vector.times(div, v); | |
} | |
static cross(v1: Vector, v2: Vector) { | |
return new Vector(v1.y * v2.z - v1.z * v2.y, | |
v1.z * v2.x - v1.x * v2.z, | |
v1.x * v2.y - v1.y * v2.x); | |
} | |
} | |
class Scale { | |
constructor( | |
public x : number, | |
public y : number, | |
public z : number | |
){} | |
static scale(k: number, v: Scale) { return new Scale(k * v.x, k * v.y, k * v.z); } | |
} | |
class bustSize{ | |
constructor( | |
public input : string, | |
public width = (Vector.string.split("").x), | |
public output : string | |
){ | |
return bustSize; | |
} | |
} | |
class kanan { | |
public idolStatus = ["terminated"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment