PHP code example of tuupola / trilateration
1. Go to this page and download the library: Download tuupola/trilateration library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once ('vendor/autoload.php' );
tuupola / trilateration example snippets
use Tuupola \Trilateration \Intersection ;
use Tuupola \Trilateration \Sphere ;
$sphere1 = new Sphere(60.1695 , 24.9354 , 81175 );
$sphere2 = new Sphere(58.3806 , 26.7251 , 162311 );
$sphere3 = new Sphere(58.3859 , 24.4971 , 116932 );
$trilateration = new Intersection($sphere1, $sphere2, $sphere3);
$point = $trilateration->position();
print_r($point);
$url = "https://appelsiini.net/circles/"
. "?c={$sphere1}&c={$sphere2}&c={$sphere3}&m={$point}" ;
print '<a href="{$url}">Open in map</a>' ;
use Tuupola \Trilateration \NonLinearLeastSquares ;
use Tuupola \Trilateration \Sphere ;
$sphere1 = new Sphere(60.1695 , 24.9354 , 81175 );
$sphere2 = new Sphere(58.3806 , 26.7251 , 162311 );
$sphere3 = new Sphere(58.3859 , 24.4971 , 116932 );
$trilateration = new NonLinearLeastSquares($sphere1, $sphere2, $sphere3);
$point = $trilateration->position();
print_r($point);
$url = "https://appelsiini.net/circles/"
. "?c={$sphere1}&c={$sphere2}&c={$sphere3}&m={$point}" ;
print '<a href="{$url}">Open in map</a>' ;