This code has been declared by its author to be Public Domain code.
Download source code | Point In Oval by UnderwoodNullium | 2008 |
| |
|
the 'ox# and oy#' is middle of the oval... :P |
Function PointInOval:Int(px#,py#,ox#,oy#,width#,height#)
Return((px - ox)^2 / width^2 + (py - oy)^2 / height^2 < 1)
End Function |
Comments |
A wee bit faster...
Function PointInOval:Int(px#,py#,ox#,oy#,width#,height#)
Return(((px - ox)*(px - ox)) / (width*width) + ((py - oy)*(py - oy)) / (height*height) < 1)
End Function
|
|
Do you know you can edit your original code? Just hit the 'Edit' button at the top-right of the code box.
|
Code Archives Forum