Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ovunc Tukenmez  >  PHP Circles Intersection  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP Circles Intersection
Find the intersection points between two circles
Author: By
Last change:
Date: 8 months ago
Size: 582 bytes
 

Contents

Class file image Download
<?php
require_once("IntersectionPointsOf2Circles.php");

/*
example:
lets find intersection points of 2 circles which have the following equations:
(x-2)^2 + (y-3)^2 = 9
(x-1)^2 + (y+1)^2 = 16
*/

$class1 = new IntersectionPointsOf2Circles(2331, -14);
$points $class1->getPoints();

print_r($points);

/*
Array
(
    [0] => Array
        (
            [x] => 4.3679314115258
            [y] => 1.1580171471185
        )

    [1] => Array
        (
            [x] => -0.95616670564347
            [y] => 2.4890416764109
        )

)
*/

?>