# calculating angles between two ranges

• Oct 1st 2010, 08:07 PM
abbastatari
calculating angles between two ranges
I have a set of angles(finite set) these are float numbers.
I need the formula to return all angles from my set that lie within a given range
Example
my set{20.33,35.55,330.00,30.00,50.00}
i will give input two angles 30,330 and i want it to return all the angles within this range.
Also that 330,30 is also a valid range.

• Oct 2nd 2010, 12:31 PM
emakarov
If $\displaystyle A$ is the set of angles, then the angles between $\displaystyle \alpha$ and $\displaystyle \beta$ are $\displaystyle \{\gamma\in A\mid \alpha\le\gamma\le\beta\}$.

I am not sure you wanted this answer, but if not, could you explain better what kind of formula you need (a mathematical expression, Excel formula, a C program, etc.)?
• Oct 2nd 2010, 03:54 PM
abbastatari
Require c++ code
I require a c++ code for this problem.
Just an addition, I can only have angles from the range of 0-360 and they can wrap around i.e.330,30 is also a valid bound
• Oct 2nd 2010, 04:25 PM
emakarov
Well, that's definitely not trigonometry. This would depend on how you represent sets in C++. Also, do you want to show some effort (e.g., attempt a solution), according to the forum rules?
• Oct 3rd 2010, 10:07 AM
HallsofIvy
There are, after all, an infinite number of angles between, say, 30 and 60 degrees- every number between 30 and 60 corresponds to an angle. Are you asking for whole degrees?