Optimising 2D rotation
问题 Given the classic formula for rotating a point in 2D space: cv::Point pt[NPOINTS]; cv::Point rotated[NPOINTS]; float angle = WHATEVER; float cosine = cos(angle); float sine = sin(angle); for (int i = 0; i < NPOINTS; i++) { rotated[i].x = pt[i].x * cosine - pt[i].y * sine; rotated[i].y = pt[i].x * sine + pt[i].y * cosine; } Given NPOINTS is 32 and the arrays are aligned, how would one go about optimising the code for SSE or AVX? Searching around here and elsewhere didn't turn up anything