public VectorBucketiser(int height, int width, XYZ zeroHVector, XYZ zeroWVector) { var perpCheck = zeroHVector.DotProduct(zeroWVector); //if (perpCheck > 0.1 || perpCheck < -0.1) throw new Exception("Zero vectors must be perpendicular"); Buckets = new VectorBucket[height, width]; _height = height; _width = width; _zeroHVector = zeroHVector; _zeroWVector = zeroWVector; createBuckets(); }
void createBuckets() { var latSegmet = Math.PI * 2 / _height; var lngSegmet = Math.PI * 2 / _width; for (int h = 0; h < _height; h++) { var hl = latSegmet * h; var hlVector = GeoUtils.RotateAboutVector(_zeroWVector, _zeroHVector, hl); for (int w = 0; w < _width; w++) { Buckets[h, w] = new VectorBucket(h, w); } } }