[go: up one dir, main page]

Menu

#93 Consider making NormalVector3D class

1.0
open
nobody
None
2014-07-16
2014-07-16
No

It might give some efficiency if there was a NormalVector3D subclass of Vector3D.

This would always return an abs of 1
It would return itself as a result of normalize

You would get one when you called normalize on Vector3D.
It would probably be made with static methods rather than a constructor, for instance:

Vector3D NormalVector3D.normalize(Vector3D v){
return new NormalVector(v.x/v.abs(), v.y/v.abs(), v.z/v.abs());
}

Just a thought.

Discussion


Log in to post a comment.