public Atom getProjectedPoint ( Atom point ) { if ( rotationPos == null ) { // translation only return null ; } Atom localPoint = Calc . subtract ( point , rotationPos ) ; double dot = Calc . scalarProduct ( localPoint , rotationAxis ) ; Atom localProjected = Calc . scale ( rotationAxis , dot ) ; Atom projected = Calc . add ( localProjected , rotationPos ) ; return projected ; }
Projects a given point onto the axis of rotation