Check if point is in (free form) shape

I need to check if coordinates x,y are inside of a certain shape. Several shapes with different parameters should be used for the check. Is there an "easy" way to do this mathematically or can I just check the background color somehow? Thx (I am totally new to graphics/processing)

Here is an example for a possible shape. star



  • in theory you can check with get()

    testColor = get ( testX, testY ) ; 
    if (testColor == blueStandard)
       println ("Inside"):
  • It can be done mathematically, in theory. In practice, it is much simpler to check the color of the shape, indeed.

Sign In or Register to comment.