I recommend looking at drawing algorithms using the implicit circle equation or the bresenham algorithm.
The Bresenham algorithm is used in Graphics.drawEllipse https://github.com/espruino/Espruino/blob/1d58afe3a70941735f15771376c841e6e57b4990/libs/graphics/graphics.c#L532 however for drawing just part of ellipse it could be tricky. simple and maybe still quick could be to compute just start and end coordinates of the arc and modify ellipse pixel drawing to skip drawing when x/y is outside when compared to start/end
some discussion here https://stackoverflow.com/questions/52484934/how-to-draw-elliptical-sector-with-bresenhams-algorithm
EDIT: there is also https://www.espruino.com/Reference#l_Graphics_setClipRect so that could work to limit drawEllipse/drawCircle
@fanoush started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The Bresenham algorithm is used in Graphics.drawEllipse
https://github.com/espruino/Espruino/blob/1d58afe3a70941735f15771376c841e6e57b4990/libs/graphics/graphics.c#L532
however for drawing just part of ellipse it could be tricky. simple and maybe still quick could be to compute just start and end coordinates of the arc and modify ellipse pixel drawing to skip drawing when x/y is outside when compared to start/end
some discussion here
https://stackoverflow.com/questions/52484934/how-to-draw-elliptical-sector-with-bresenhams-algorithm
EDIT: there is also https://www.espruino.com/Reference#l_Graphics_setClipRect so that could work to limit drawEllipse/drawCircle