Ellipse diameter depending on mouse position

i need help drawing an ellipse that’s diameter will depend on the mouse moving position…
like when the y position increase and the x position decrease the diameter will in increase and vise versa… plus the ellipse should stay on a still position when the mouse pressed is released …

Hello,

I would start by exploring the resources on the Processing website:

https://processing.org/

:)

References:
image

Examples:
image

Check out the Tutorials!

Coordinate System and Shapes:

https://processing.org/tutorials/drawing/

Interactivity:

https://processing.org/tutorials/interactivity/

i did look there but cant find the function that will keep the ellipse on a certain position when mousepressed is released

look at map() to map mouseX to a diameter

Hello,

The map() function may be helpful.

Do some exploration on the website.

:)

When you get rid of background the ellipse will stay

Welcome to the forum!

It sounds like you (@mdhasan6230) also asks about how to calculate the ellipse radius (or diameter)?
Or maybe you just wanted to draw an ellipse?