I am implementing a little game in c with sdl2/sdl_gfx for an assignment where you need to avoid the arcs coming at you (in the center) by moving the little cursor under the white circle (it moves around the circle).
My question is simple: what can be an efficient implementation to detect if my cursor intersect an arc?
For each arcs have : the center point (x,y), starting and ending points, radius.
Which are the arguments of:
int arcRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
For my cursor (the little triangle under the circle) i have : the coordinates of the triangle.
int filledTrigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Having this information, i thought about using Lines of my triangle to detect if it intersects with an arc. But i dont know how to implement it with the maths involved in it.
Note: The Arcs are moving and their coordinates are updated each frame. I only need to know the implementation to detect an intersection.