I am unsure how to find a point that resides within a given angle.
float angleSize = 45; //rep. 45 degree angle
float rototation = 0;
float min = rotation - angleSize / 2.0f;
float max = rotation + angleSize / 2.0f;
//todo : create angle
//todo : is position in that angle? (2d)
Any ideas?

1 answers
Do you mean that you want to find out whether a given point lies within a sector of a circle subtended by a particular angle?
If so, you first need to check whether the distance between the point and the center of the circle is less than or equal to its radius i.e. that it's somewhere within the circle.
You then need to work out the angle which a line drawn from the center of the circle to the point makes with the positive x-axis (in a clockwise direction) and compare this with the starting and finishing angles of the sector's radii.
Here's some simple code I've written which hopefully does this:
answered one year ago by:
17279