Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:12:44+00:00 2026-06-04T00:12:44+00:00

How do you determine if a point is inside a closed SVG path with

  • 0

How do you determine if a point is inside a closed SVG path with javascript? Why does the following code not work as expected?

var paper = Raphael(0, 0, 600, 600);

var p = paper.path("M82.725,37.884l0.777,1.555l-20.391,9.569l-17.714,7.453L27.508,68.212v3.111l-6.997,19.442l16.329,20.996 l7.864,21.019l0.477,13.026l5.658,10.284l4.666,3.886l-2.333,2.336l7.002,0.777v6.219l3.886,10.888l8.555,0.778l-8.555,4.363 l-10.11-2.03l1.016,24.043l2.873,11.73l0.777-2.333l4.667,16.329l3.111-0.778L56.047,350.44l-16.052,32.639l-8.381,19.527 l15.253,11.277l7.083,9.399l49.77,20.129l8.726,4.064l16.917,3.736l10.131,6.222l27.195,6.222l7.799,4.079l17.865,0.284 l16.354,5.292l72.321,17.903l60.463,45.627l18.082,16.633l-2.032-24.106l-34.777-76.215l-12.66-41.99l-1.447-22.556l-6.826-30.328 l-2.851-12.442l5.054-10.108l5.206-14.061l-0.214-10.045l1.555-14.779h7.774l7.002-3.111l-4.495-27.996l-2.593-27.93l4.753-28.06 l8.555-3.241l20.217-3.652l7.002-3.995l42.771-4.837l13.999,6.393h-3.111l0.777,4.666l3.889-1.558l1.555,3.891h-3.109l4.6,32.661 l3.176,27.219l3.111,0.775l18.662,2.271l12.443,0.062l15.078,6.224l12.139,38.105h-31.926l-1.512,6.997l-2.334,0.775l2.334,3.891 l6.998-6.222l-0.777,4.666l0.777,4.667l15.555-9.333l2.332,0.78l10.889,3.886l-2.336-6.221l3.414,18.664l-8.057,45.126l-4.213,55.97 l-10.584,59.88l7.582,31.108l1.035,24.106L477,579.916h31.105V36.33l-14.777,6.522L442.004,58.88l-24.107,9.636l-32.663,5.032 l-41.993-11.557v-2.333l-45.104-13.219l-9.268-6.761L250.7,25.982L145,20.084L103.72,31.058L82.725,37.884z");

p.isPointInside(165,100); // returns false, but when I draw a circle at that point, it is clearly inside the path.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:12:45+00:00Added an answer on June 4, 2026 at 12:12 am

    This isn’t going to answer your problem, or even help much. A bit of googling came up with this issue, along with an observation – the bug seems to be affected by whether you’re using floats or integers.

    I’ve put your code in this fiddle, and it seems like they’re right, though in your case, using the decimals makes it work, not break. Perhaps you could use this nugget of information to skirt around the issue somehow.

    Credit goes to the creator of the issue on github.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to determine if a Point P(x,y,z) is inside a 2D circle in
How do I determine if a point is inside or outside a polygon that
I'm attempting to determine if a specific point lies inside a polyhedron. In my
What is the simplest algorithm to determine if a point is inside a 2d
I'm trying to determine if a point is inside a polygon. the Polygon is
how to determine if a POINT is inside the area of a button? the
I wish to determine the intersection point between a ray and a box. The
I need to determine the quadrant of point, in a faster way. I am
I need a function to determine if a directory is a mount point for
I need an algorithm (3D), which would determine if point belongs to a triangle.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.