Maths Extension methods for JavaScript