Wrox Programmer Forums
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2006, 07:42 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default boolean

 Hey. my first post. How do you write a java class method that takes two Rectangle object as parameter and returns true if the rectangle overlape each other when given x and y corordinate, length and width for both rectangle. I know you suppose to use a boolean meathod and one way is to match up all four coordinate but is there any other way?

 
Old April 6th, 2006, 02:58 PM
Authorized User
 
Join Date: Oct 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SiliconFuRy
Default

Do you already have an algorithm to find out if the 2 objects overlap?

Many shoes,

Jamez/SiliconFuRy
 
Old April 6th, 2006, 05:34 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by SiliconFuRy
 Do you already have an algorithm to find out if the 2 objects overlap?

Many shoes,

Jamez/SiliconFuRy
I was thinking of using only one cordinate of both Rectangle. like the given bottomLeft X AND Y of the both rectangle. and set it to a range according the height and width given.Since in math, there must be a fix distance between two bottom left corner in order for triangle to overlap no matter the position of the rectangle. but the thing is i did all the math but the only thing is i can't do it in java due to the syntax and everything else.





Similar Threads
Thread Thread Starter Forum Replies Last Post
The boolean data type in C++? code_lover C++ Programming 2 July 14th, 2008 01:11 AM
help me with boolean array Un33k Pro Visual Basic 2005 1 June 12th, 2007 11:43 AM
Save Checkbox with boolean 0/1 value rdove84 ASP.NET 1.0 and 1.1 Basics 5 October 24th, 2006 09:12 AM
Convert variable to boolean stephanel Javascript How-To 2 June 25th, 2003 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.