René's URL Explorer Experiment


Title: [BUG]: ConvexHull algorithm crashes with division by zero on vertical lines · Issue #1815 · TheAlgorithms/JavaScript · GitHub

Open Graph Title: [BUG]: ConvexHull algorithm crashes with division by zero on vertical lines · Issue #1815 · TheAlgorithms/JavaScript

X Title: [BUG]: ConvexHull algorithm crashes with division by zero on vertical lines · Issue #1815 · TheAlgorithms/JavaScript

Description: Description The current ConvexHull implementation has a critical bug in the orientation function that causes division by zero when processing points that share the same x-coordinate (vertical lines). Location File: Geometry/ConvexHull.js...

Open Graph Description: Description The current ConvexHull implementation has a critical bug in the orientation function that causes division by zero when processing points that share the same x-coordinate (vertical lines...

X Description: Description The current ConvexHull implementation has a critical bug in the orientation function that causes division by zero when processing points that share the same x-coordinate (vertical lines...

Opengraph URL: https://github.com/TheAlgorithms/JavaScript/issues/1815

X: @github

direct link

Domain: togithub.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: ConvexHull algorithm crashes with division by zero on vertical lines","articleBody":"### Description\n\nThe current ConvexHull implementation has a critical bug in the `orientation` function that causes division by zero when processing points that share the same x-coordinate (vertical lines).\n\n## Location\nFile: `Geometry/ConvexHull.js`\nFunction: `orientation(a, b, c)`\n\n### Expected Behavior\n\nThe algorithm should handle vertical lines correctly and return the proper convex hull vertices.\n\n### Actual Behavior\n\n### Current Implementation (Buggy):\n```javascript\nfunction orientation(a, b, c) {\n  const alpha = (b.y - a.y) / (b.x - a.x)  // ❌ Division by zero!\n  const beta = (c.y - b.y) / (c.x - b.x)   // ❌ Division by zero!\n  \n  if (alpha \u003e beta) return 1\n  else if (beta \u003e alpha) return -1\n  return 0\n}\n```\n\n## Problem:\nWhen b.x === a.x or c.x === b.x, the division results in Infinity or NaN, causing incorrect results or crashes.\nSteps to Reproduce\n```javascript\nimport { convexHull } from './Geometry/ConvexHull.js'\n\n// Points with same x-coordinate (vertical line)\nconst points = [\n  { x: 2, y: 0 },\n  { x: 2, y: 1 },  // Same x as above\n  { x: 2, y: 2 },  // Same x as above\n  { x: 0, y: 1 },\n  { x: 4, y: 1 }\n]\n\nconvexHull(points)  // ❌ Returns incorrect result or crashes","author":{"url":"https://github.com/bhautikrathod9","@type":"Person","name":"bhautikrathod9"},"datePublished":"2025-10-02T18:49:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1815/JavaScript/issues/1815"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:202bbb2d-df24-686b-c1da-5b5f7a221de4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDBFA:C18A5:8BB47F:C60F4F:696A519F
html-safe-nonced82d985d4ec6cc860f1c201c0eed0ba1a60fda4fbaa164a4571c85a56a9b5463
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkZBOkMxOEE1OjhCQjQ3RjpDNjBGNEY6Njk2QTUxOUYiLCJ2aXNpdG9yX2lkIjoiNTI0NTI0MDYzNjA1MzU0MTI3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac420ca2bbd81e35c59cc1e4050cb589ef00c9237a50ac35b8a5f4c1c0c7329446
hovercard-subject-tagissue:3478557649
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheAlgorithms/JavaScript/1815/issue_layout
twitter:imagehttps://opengraph.githubassets.com/28f6c210c35581cae7f90d8efdad708e3f29853162252c83dcef381b36c8eca9/TheAlgorithms/JavaScript/issues/1815
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/28f6c210c35581cae7f90d8efdad708e3f29853162252c83dcef381b36c8eca9/TheAlgorithms/JavaScript/issues/1815
og:image:altDescription The current ConvexHull implementation has a critical bug in the orientation function that causes division by zero when processing points that share the same x-coordinate (vertical lines...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebhautikrathod9
hostnamegithub.com
expected-hostnamegithub.com
None3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef
turbo-cache-controlno-preview
go-importgithub.com/TheAlgorithms/JavaScript git https://github.com/TheAlgorithms/JavaScript.git
octolytics-dimension-user_id20487725
octolytics-dimension-user_loginTheAlgorithms
octolytics-dimension-repository_id97086543
octolytics-dimension-repository_nwoTheAlgorithms/JavaScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id97086543
octolytics-dimension-repository_network_root_nwoTheAlgorithms/JavaScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release63c426b30d262aba269ef14c40e3c817b384cd61
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://togithub.com/TheAlgorithms/JavaScript/issues/1815#start-of-content
https://togithub.com/
Sign in https://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJavaScript%2Fissues%2F1815
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJavaScript%2Fissues%2F1815
Sign up https://togithub.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=TheAlgorithms%2FJavaScript
Reloadhttps://togithub.com/TheAlgorithms/JavaScript/issues/1815
Reloadhttps://togithub.com/TheAlgorithms/JavaScript/issues/1815
Reloadhttps://togithub.com/TheAlgorithms/JavaScript/issues/1815
TheAlgorithms https://togithub.com/TheAlgorithms
JavaScripthttps://togithub.com/TheAlgorithms/JavaScript
Please reload this pagehttps://togithub.com/TheAlgorithms/JavaScript/issues/1815
Notifications https://togithub.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Fork 5.8k https://togithub.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Star 34k https://togithub.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Code https://togithub.com/TheAlgorithms/JavaScript
Issues 21 https://togithub.com/TheAlgorithms/JavaScript/issues
Pull requests 167 https://togithub.com/TheAlgorithms/JavaScript/pulls
Actions https://togithub.com/TheAlgorithms/JavaScript/actions
Projects 0 https://togithub.com/TheAlgorithms/JavaScript/projects
Wiki https://togithub.com/TheAlgorithms/JavaScript/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://togithub.com/TheAlgorithms/JavaScript/security
Please reload this pagehttps://togithub.com/TheAlgorithms/JavaScript/issues/1815
Insights https://togithub.com/TheAlgorithms/JavaScript/pulse
Code https://togithub.com/TheAlgorithms/JavaScript
Issues https://togithub.com/TheAlgorithms/JavaScript/issues
Pull requests https://togithub.com/TheAlgorithms/JavaScript/pulls
Actions https://togithub.com/TheAlgorithms/JavaScript/actions
Projects https://togithub.com/TheAlgorithms/JavaScript/projects
Wiki https://togithub.com/TheAlgorithms/JavaScript/wiki
Security https://togithub.com/TheAlgorithms/JavaScript/security
Insights https://togithub.com/TheAlgorithms/JavaScript/pulse
New issuehttps://togithub.com/login?return_to=https://github.com/TheAlgorithms/JavaScript/issues/1815
New issuehttps://togithub.com/login?return_to=https://github.com/TheAlgorithms/JavaScript/issues/1815
#1847https://github.com/TheAlgorithms/JavaScript/pull/1847
[BUG]: ConvexHull algorithm crashes with division by zero on vertical lineshttps://togithub.com/TheAlgorithms/JavaScript/issues/1815#top
#1847https://github.com/TheAlgorithms/JavaScript/pull/1847
bugSomething isn't workinghttps://github.com/TheAlgorithms/JavaScript/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/bhautikrathod9
https://github.com/bhautikrathod9
bhautikrathod9https://github.com/bhautikrathod9
on Oct 2, 2025https://github.com/TheAlgorithms/JavaScript/issues/1815#issue-3478557649
bugSomething isn't workinghttps://github.com/TheAlgorithms/JavaScript/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.