but in my project, the ultrasonic sensor will move from 15 degrees to 165 degrees and the ultrasonic sensor will move width but to measure the width I can use the formula s=rtheta. where s is the width of the object and r is the the distance between ultrasonic sensor and the object(this part is easy). and the theta is degree