Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Atul Aggarwal
- //Outline Circle
- import javafx.application.Application;
- import javafx.scene.Scene;
- import javafx.scene.layout.Pane;
- import javafx.scene.paint.Color;
- import javafx.scene.shape.Circle;
- import javafx.scene.shape.Line;
- import javafx.stage.Stage;
- import java.util.ArrayList;
- public class OutlineCircle extends Circle {
- //Constructor for Outline Circle
- public OutlineCircle() {
- super.setFill(Color.TRANSPARENT);
- super.setStroke(Color.GREEN);
- }
- //Determine if a OutlineCircle overlaps another OutlineCircle
- public boolean overlaps(OutlineCircle c){
- boolean result = false;
- // see if distance between the two
- // circles is less than the sum of each
- // radius
- return Math.sqrt((Math.pow((getCenterX()-c.getCenterX()),2)) +
- (Math.pow(getCenterY()-c.getCenterY(),2)));
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement