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 8923081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:01:17+00:00 2026-06-15T07:01:17+00:00

Hey I was writing a quick program and something came across where I need

  • 0

Hey I was writing a quick program and something came across where I need to use a circle for collision detection. But as far as I know, there is only the Rectangle class that has the .intersects(Point p) method. Is there anything like a circle that I could use the same way?

  • 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-15T07:01:20+00:00Added an answer on June 15, 2026 at 7:01 am

    There is a class called Ellipse2D in the java.awt.geom package that you can use, since it has some methods that appears to be what you’re looking for. An ellipse with a width equal to its height is a circle.

    One of the overloads for contains allows you to test for circle-point collisions:

    boolean contains(double x, double y) 
    

    Tests if the specified coordinates are inside the boundary of the
    Shape, as described by the definition of insideness.

    Another function called intersects allows you to test for circle-rectangle collisions:

    boolean intersects(double x, double y, double w, double h)
    

    Tests if the interior of the Shape intersects the interior of a specified rectangular area.

    Note that Ellipse2D is an abstract class; you would use one of its nested subclasses Ellipse2D.Double or Ellipse2D.Float, the only difference being the data type used to store the dimensions.

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

Sidebar

Related Questions

hey I'm writing on an Server-Client program but when my client sends something, it
Hey, for an application I am writing I need to use the data which
Hey guys I'm writing a simple web program to get my feet wet in
I am writing a search engine (why not hey?) and need to handle navigating
hey im writing a c# flv2mp3 converter and i could need some help. flv
Hey, I've been writing a program (a sort of e-Book viewing type thing) and
Hey guys, Im working with wpf 3d, im currently writing a program that will
hey just a couple quick noob questions about writing my first ios app. Ive
Hey all, I'm writing a program that takes in a string representation of a
Hey so I am currently writing a program for university and when creating my

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.