12 February 2011

Reflecting on the hard work I've put into my research code

I am still proud of my code to get the angle in a quadrature set reflected across an axis. It's a little crazy.

const AngleT& getReflectedAngle(const AngleT& a, unsigned int axis ) const {
    return angles_[ (a.getOctantIndex() ^ (1 + ( axis << 1)) + 1) * numAnglesPerOctant_ - 1 - a.getSubIndex() ];
}

This section of code is copyright © 2011 Seth R Johnson, All rights reserved.

0 comments:

Post a Comment