vector<CGPoint>::iterator i;
vector<CGPoint>* bp = bicyclePad.bikePathPoints;
for(i = bp->begin(); i != bp->end()-3; i++){
angle = atan2((*i).y/(*i).x) * 180/ PI;
}
I guess atan2 can only be used with floats and doubles. but I am trying to do it with an iterator. How would I go about doing the above?
atan2takes two arguments:should work fine. The correct overload (depending on what
CGFloattypedefs to) will be chosen.Note that
i->xandi->y(which are strictly equivalent to(*i).xand(*i).y) are numbers (of typeCGFloat), not iterators.