withLength

fun Vec3.withLength(newLength: Double): Vec3

this.normalize().scale(newLength)

Return

a Vec3 with same direction as the receiver and length of newLength.