Hi everyone. I’m not sure if what I’m doing to get the degree for the tilt_servo to find the range of the bot to the rack is correct.

I wrote this in **tracking.c** at the very bottom:

```
unsigned float Find_Distance(void)
{
float radian;
float range;
radian = ((((angle I will measure in degrees that the tilt servo has to offer from down to up) / 256) * pi) / 180) * pwm07(which is my tilt_servo pwm);
range = (116 - (distance I have yet to measure between the floor and my camera because we haven't placed it yet)) / tan(radian);
return(range);
}
```

I read on another thread that the angle has to be in radians for the Tan() function to take in. Also, does it matter in which source file I place this function? SO, my real questions are, Does anything about what I wrote make sense? And how does this compare to the:

pan angle = ((current pan PWM) - (pan center PWM)) * degrees/pan PWM step ?(other than I’m looking for tilt rather than pan). Do I have to subtract my pwm07 by something like you did in this one? Sorry if I’m being confusing, but I’m trying to understand all of this at once. (My team is made up of 5 people and I’m the only electrician and the only programmer and I don’t have much experience as a junior in high school.)