view release on metacpan or search on metacpan
Genetics/API/DB/Insert.pm view on Meta::CPAN
$sth->finish() ;
# Code data
if ( $svFormat eq "Code" ) {
$sth = $dbh->prepare( "insert into CodeDerivation
(codeDerivationID, studyVariableID, code,
description, formula)
values (?, ?, ?, ?, ?)" ) ;
if ($svCategory eq "StaticLiabilityClass") {
$sth1 = $dbh->prepare( "insert into StaticLCPenetrance
(cdID, pen11, pen12, pen22, malePen1, malePen2)
values (?, ?, ?, ?, ?, ?)" ) ;
Genetics/API/DB/Insert.pm view on Meta::CPAN
$asdID = $sth->{'mysql_insertid'} ;
$sth->finish() ;
# AffectionStatusElement fields
if ( defined($aseListPtr = $$asdPtr{AffStatElements}) ) {
$sth = $dbh->prepare( "insert into AffectionStatusElement
(asElementID, asDefID, code, type, formula)
values (?, ?, ?, ?, ?)" ) ;
foreach $asePtr (@$aseListPtr) {
$sth->execute(undef, $asdID, $$asePtr{code}, $$asePtr{type}, $$asePtr{formula}) ;
}
$sth->finish() ;
}
# LiabilityClass data
# NB: these are dynamic LCs; if the SV is of category StaticLiabilityClass,
Genetics/API/DB/Insert.pm view on Meta::CPAN
$sth->finish() ;
# LiabilityClass fields
$lcListPtr = $$lcDefPtr{LiabilityClasses} ;
$sth = $dbh->prepare( "insert into LiabilityClass
(lcID, lcDefID, code, description, pen11, pen12,
pen22, malePen1, malePen2, formula)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ) ;
foreach $lcPtr (@$lcListPtr) {
$sth->execute(undef, $lcdID, $$lcPtr{code}, $$lcPtr{description}, $$lcPtr{pen11}, $$lcPtr{pen12}, $$lcPtr{pen22}, $$lcPtr{malePen1}, $$lcPtr{malePen2}, $$lcPtr{formula}) ;
}
$sth->finish() ;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Genome/Model/Tools/Music/ClinicalCorrelation.pm.R view on Meta::CPAN
# self-defined x.names have to be found in column names of y.file and/or x.file
#################### myglm fuction ##############
myglm=function(z,trait,variant,covar=NA,ytype) {
if (nchar(covar)==0 | is.na(covar) | is.null(covar)) {
model=formula(paste(trait,"~",variant))
} else {
model=formula(paste(trait,"~",variant,"+",covar))
}
if (ytype=="B") fit=glm(formula=model,data=z,family=binomial(link = "logit"))
if (ytype=="Q") fit=glm(formula=model,data=z,family=gaussian(link = "identity"))
fit
}
#################################################
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Calc/XS.pm view on Meta::CPAN
=head1 DESCRIPTION
B<Geo::Calc::XS> implements a variety of calculations for latitude/longitude points
All these formulas are for calculations on the basis of a spherical earth
(ignoring ellipsoidal effects), which is accurate enough for most purposes.
[ In fact, the earth is very slightly ellipsoidal; using a spherical model
gives errors typically up to 0.3% ].
lib/Geo/Calc/XS.pm view on Meta::CPAN
$gc->distance_to( $point[, $precision] )
$gc->distance_to( { lat => 40.422371, lon => -3.704298 } )
$gc->distance_to( Geo::Calc::XS->new( lat => 40.422371, lon => -3.704298 ) )
This uses the "haversine" formula to calculate great-circle distances between
the two points - that is, the shortest distance over the earth's surface -
giving an `as-the-crow-flies` distance between the points (ignoring any hills!)
The haversine formula `remains particularly well-conditioned for numerical
computation even at small distances` - unlike calculations based on the spherical
law of cosines. It was published by R W Sinnott in Sky and Telescope, 1984,
though known about for much longer by navigators. (For the curious, c is the
angular distance in radians, and a is the square of half the chord length between
the points).
lib/Geo/Calc/XS.pm view on Meta::CPAN
(orthodrome); the final heading will differ from the initial heading by varying
degrees according to distance and latitude (if you were to go from say 35N,45E
(Baghdad) to 35N,135E (Osaka), you would start on a heading of 60 and end up on
a heading of 120!).
This formula is for the initial bearing (sometimes referred to as forward
azimuth) which if followed in a straight line along a great-circle arc will take
you from the start point to the end point
Returns the (initial) bearing from this point to the supplied point, in degrees
with the specified pricision
lib/Geo/Calc/XS.pm view on Meta::CPAN
$gc->destination_point( $bearing, $distance[, $precision] );
$gc->destination_point( 90, 1 );
Returns the destination point and the final bearing using Vincenty inverse
formula for ellipsoids.
C<$bearing> must be specified in degrees, where 0 is north and 90 is east, and
C<$distance> must be specified in this object's distance unit.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Calc.pm view on Meta::CPAN
=head1 DESCRIPTION
C<Geo::Calc> implements a variety of calculations for latitude/longitude points
All these formulare are for calculations on the basis of a spherical earth
(ignoring ellipsoidal effects) which is accurate enough* for most purposes.
[ In fact, the earth is very slightly ellipsoidal; using a spherical model
gives errors typically up to 0.3% ].
lib/Geo/Calc.pm view on Meta::CPAN
=head2 distance_to
$gc->distance_to( $point[, $precision] )
$gc->distance_to( { lat => 40.422371, lon => -3.704298 } )
This uses the "haversine" formula to calculate great-circle distances between
the two points - that is, the shortest distance over the earth's surface -
giving an `as-the-crow-flies` distance between the points (ignoring any hills!)
The haversine formula `remains particularly well-conditioned for numerical
computation even at small distances` - unlike calculations based on the spherical
law of cosines. It was published by R W Sinnott in Sky and Telescope, 1984,
though known about for much longer by navigators. (For the curious, c is the
angular distance in radians, and a is the square of half the chord length between
the points).
lib/Geo/Calc.pm view on Meta::CPAN
(orthodrome); the final heading will differ from the initial heading by varying
degrees according to distance and latitude (if you were to go from say 35N,45E
(Baghdad) to 35N,135E (Osaka), you would start on a heading of 60 and end up on
a heading of 120!).
This formula is for the initial bearing (sometimes referred to as forward
azimuth) which if followed in a straight line along a great-circle arc will take
you from the start point to the end point
Returns the (initial) bearing from this point to the supplied point, in degrees
with the specified pricision
lib/Geo/Calc.pm view on Meta::CPAN
$gc->destination_point( $bearing, $distance[, $precision] );
$gc->destination_point( 90, 1 );
Returns the destination point and the final bearing using Vincenty inverse
formula for ellipsoids.
=cut
method destination_point ( Num $brng!, Num $s!, Int $precision? = -6 ) returns (HashRef[Num]) {
my $lat1 = $self->get_lat();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/CheapRuler.pm view on Meta::CPAN
Very fast as they use just 1 trig function per call.
=head1 MATHS MODEL
The Maths model is based upon an approximation to Vincenty's formulae, which uses the Earth's actual shape, an oblate ellipsoid (squashed sphere). For 'city' scale work, it is still more accurate than
the Haversine formulae (which uses several trig calls based upon a spherical Earth). For an explanation, see
https://blog.mapbox.com/fast-geodesic-approximations-with-cheap-ruler-106f229ad016
=head1 EXPORT
Nothing
lib/Geo/CheapRuler.pm view on Meta::CPAN
croak( 'No latitude given.') if ! defined $lat;
croak( "Unknown unit $units. Use one of: " + join( ', ', keys(%FACTORS) ) ) if $units && ! $FACTORS{ $units };
my $self = bless {};
# Curvature formulas from https://en.wikipedia.org/wiki/Earth_radius#Meridional
my $m = $RAD * $RE * ( $units ? $FACTORS{ $units } : 1 );
my $coslat = cos( $lat * $RAD );
my $w2 = 1 / (1 - $E2 * (1 - $coslat**2) );
my $w = sqrt($w2);
lib/Geo/CheapRuler.pm view on Meta::CPAN
GIS::Distance
https://metacpan.org/pod/GIS::Distance
Group of modules with XS versions which implement Haversine and Vincenty distance formulas
Consider for longer than 'city scale' distances, or near the Poles.
GIS::Distance::Vincenty
The more accurate formulae which this module approximates. There is an XS version of it.
https://metacpan.org/pod/GIS::Distance::Vincenty
=head1 SUPPORT
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Coordinates/Converter/LV03.pm view on Meta::CPAN
#_}
#_{ Warning
=head1 WARNING
The document from which I derived the formulas (see LINKS) contains
this friendly warning; »I<Diese Formeln haben eine reduzierte Genauigkeit und sind
vor allem für Navigationszwecke vorgesehen. Sie dürfen nicht für die amtliche Vermessung oder für geodätische Anwendungen verwendet werden!>« (that is: only to be used for navigational purposes,
not of exact (or even official) measurements or geodatic applications).
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Coordinates/ETRSTM35FIN.pm view on Meta::CPAN
=head1 AUTHOR
Perl port and CPAN package Matti Lattu, <matti@lattu.biz>
The conversion formulae have been acquired from a Python module from Olli Lammi
L<http://olammi.iki.fi/sw/fetch_map/>.
=head1 ACKNOWLEDGEMENTS
The Perl realization follows closely Geo::Coordinates::KKJ by Josep Roca.
view all matches for this distribution
view release on metacpan or search on metacpan
double tan2;
double tan3;
double tan4;
double tan5;
double tan6;
double t1; /* Term in coordinate conversion formula - GP to Y */
double t2; /* Term in coordinate conversion formula - GP to Y */
double t3; /* Term in coordinate conversion formula - GP to Y */
double t4; /* Term in coordinate conversion formula - GP to Y */
double t5; /* Term in coordinate conversion formula - GP to Y */
double t6; /* Term in coordinate conversion formula - GP to Y */
double t7; /* Term in coordinate conversion formula - GP to Y */
double t8; /* Term in coordinate conversion formula - GP to Y */
double t9; /* Term in coordinate conversion formula - GP to Y */
double tmd; /* True Meridional distance */
double tmdo; /* True Meridional distance for latitude of origin */
long Error_Code = TRANMERC_NO_ERROR;
double temp_Origin;
double temp_Long;
double sn; /* Radius of curvature in the prime vertical */
double sr; /* Radius of curvature in the meridian */
double t; /* Tangent of latitude */
double tan2;
double tan4;
double t10; /* Term in coordinate conversion formula - GP to Y */
double t11; /* Term in coordinate conversion formula - GP to Y */
double t12; /* Term in coordinate conversion formula - GP to Y */
double t13; /* Term in coordinate conversion formula - GP to Y */
double t14; /* Term in coordinate conversion formula - GP to Y */
double t15; /* Term in coordinate conversion formula - GP to Y */
double t16; /* Term in coordinate conversion formula - GP to Y */
double t17; /* Term in coordinate conversion formula - GP to Y */
double tmd; /* True Meridional distance */
double tmdo; /* True Meridional distance for latitude of origin */
long Error_Code = TRANMERC_NO_ERROR;
if ((Easting < (TranMerc_False_Easting - TranMerc_Delta_Easting))
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Coordinates/OSGB.pm view on Meta::CPAN
=head1 NAME
Geo::Coordinates::OSGB - Convert coordinates between Lat/Lon and the British National Grid
An implementation of co-ordinate conversion for England, Wales, and Scotland
based on formulae and data published by the Ordnance Survey of Great Britain.
=head1 VERSION
2.20
lib/Geo/Coordinates/OSGB.pm view on Meta::CPAN
See the test files for more examples of usage.
=head1 BUGS AND LIMITATIONS
The formulae supplied by the OS and used for the conversion routines are
specifically designed to be close floating-point approximations rather
than exact mathematical equivalences. So after round-trips like these:
($lat1,$lon1) = grid_to_ll(ll_to_grid($lat0,$lon0));
($e1,$n1) = ll_to_grid(grid_to_ll($e0,$n0));
neither C<$lat1 == $lat0> nor C<$lon1 == $lon0> nor C<$e1 == $e0> nor
C<$n1 == $n0> exactly. However the differences should be very small.
The OS formulae were designed to give an accuracy of about 1 mm of
error. This means that you can rely on the third decimal place for grid
references and about the seventh or eighth for latitude and longitude
(although the OS themselves only provide six decimal places in their
results).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Coordinates/RDNAP.pm view on Meta::CPAN
These transformations should only be used for locations in or close to
the Netherlands.
See http://www.rdnap.nl/ for a description of the RD-NAP system;
especially http://www.rdnap.nl/download/rdnaptrans.pdf for the formulas
used in this module.
=head2 Precision
This module implements an approximated transformation, which should be
view all matches for this distribution
view release on metacpan or search on metacpan
* B = -2[(Ex cos(arc to W) - Wx cos(arc to E))(ExWz-EzWx) -
* (Ey cos(arc to W) -Wy cos(arc to E))(EyWz-EzWy)];
* C = (Ex cos(arc to W) - Wx cos(arc to E))^2 +
* (Ey cos(arc to W) - Wy cos(arc to E))^2 -
* (ExWy - EyWx)^2.
* Solve with the quadratic formula. The latitude is simply the
* arc sine of Pz. Px and Py satisfy
* ExPx + EyPy + EzPz = cos(arc to E);
* WxPx + WyPy + WzPz = cos(arc to W).
* Substitute Pz's value, and solve linearly to get Px and Py.
* The longitude is the arc tangent of Px/Py.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/DNA.pm view on Meta::CPAN
my ( $ga, $gb ) = @_;
my ( $alat, $alon ) = decode( $ga );
my ( $blat, $blon ) = decode( $gb );
# if a[1] and b[1] have different signs, we need to translate
# everything a bit in order for the formulae to work.
if ( $alon * $blon < 0.0 && abs( $alon - $blon ) > 180.0 ) {
( $alat, $alon ) = add_vector( $ga, 0.0, 180.0 );
( $blat, $blon ) = add_vector( $gb, 0.0, 180.0 );
}
my $x = ( deg2rad( $blon ) - deg2rad( $alon ) ) * cos( ( deg2rad( $alat ) + deg2rad( $blat ) ) / 2 );
view all matches for this distribution
view release on metacpan or search on metacpan
ex/benchmark.pl view on Meta::CPAN
# Uses lat/lon instead of lon/lat
my $d = $gis->distance(@coord[ 1, 0, 3, 2 ]);
return $d->mile;
}
my %gis_formula = (
hsin => 'Haversine',
polar => 'Polar',
cos => 'Cosine',
gcd => 'GreatCircle',
mt => 'MathTrig',
tv => 'Vincenty',
);
for my $formula (qw(hsin tv polar cos gcd mt)) {
print "---- [ Formula: $formula ] ------------------------------------\n";
$geo->formula($formula);
$gis->formula($gis_formula{$formula});
Geo::Distance::XS->unimport;
printf "perl - distance from LA to NY: %s miles\n", geo();
Geo::Distance::XS->import;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Distance.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self = bless {}, $class;
my %args = @_;
$self->{formula} = 'hsin';
$self->{units} = {};
if(!$args{no_units}){
$self->reg_unit( $KILOMETER_RHO, 'kilometer' );
$self->reg_unit( 1000, 'meter', => 'kilometer' );
$self->reg_unit( 100, 'centimeter' => 'meter' );
lib/Geo/Distance.pm view on Meta::CPAN
}
return $self;
}
sub formula {
my $self = shift;
return $self->{formula} if !$_[0];
my $formula = shift;
my $gis_formula = $GEO_TO_GIS_FORMULA_MAP{ $formula };
croak(
'Unknown formula (available formulas are ',
join(', ', sort @FORMULAS),
')',
) if !$gis_formula;
$self->{formula} = $formula;
$self->{gis_formula} = $gis_formula;
return $formula;
}
sub distance {
my ($self, $unit, $lon1, $lat1, $lon2, $lat2) = @_;
my $unit_rho = $self->{units}->{$unit};
croak('Unkown unit type "' . $unit . '"') if !$unit_rho;
my $gis = GIS::Distance->new( $self->{gis_formula} );
# Reverse lon/lat to lat/lon, the way GIS::Distance wants it.
my $km = $gis->{code}->( $lat1, $lon1, $lat2, $lon2 );
return $km * ($unit_rho / $KILOMETER_RHO);
lib/Geo/Distance.pm view on Meta::CPAN
sub old_distance {
my($self,$unit,$lon1,$lat1,$lon2,$lat2) = @_;
croak('Unkown unit type "'.$unit.'"') unless($unit = $self->{units}->{$unit});
return 0 if $self->{formula} eq 'null';
return 0 if $self->{formula} eq 'alt';
if($self->{formula} eq 'mt'){
return great_circle_distance(
deg2rad($lon1),
deg2rad(90 - $lat1),
deg2rad($lon2),
deg2rad(90 - $lat2),
lib/Geo/Distance.pm view on Meta::CPAN
}
$lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1);
$lon2 = deg2rad($lon2); $lat2 = deg2rad($lat2);
my $c;
if($self->{formula} eq 'cos'){
my $a = sin($lat1) * sin($lat2);
my $b = cos($lat1) * cos($lat2) * cos($lon2 - $lon1);
$c = acos($a + $b);
}
elsif($self->{formula} eq 'hsin'){
my $dlon = $lon2 - $lon1;
my $dlat = $lat2 - $lat1;
my $a = (sin($dlat/2)) ** 2 + cos($lat1) * cos($lat2) * (sin($dlon/2)) ** 2;
$c = 2 * atan2(sqrt($a), sqrt(abs(1-$a)));
}
elsif($self->{formula} eq 'polar'){
my $a = pi/2 - $lat1;
my $b = pi/2 - $lat2;
$c = sqrt( $a ** 2 + $b ** 2 - 2 * $a * $b * cos($lon2 - $lon1) );
}
elsif($self->{formula} eq 'gcd'){
$c = 2*asin( sqrt(
( sin(($lat1-$lat2)/2) )**2 +
cos($lat1) * cos($lat2) *
( sin(($lon1-$lon2)/2) )**2
) );
# Eric Samuelson recommended this formula.
# http://forums.devshed.com/t54655/sc3d021a264676b9b440ea7cbe1f775a1.html
# http://williams.best.vwh.net/avform.htm
# It seems to produce the same results at the hsin formula, so...
#my $dlon = $lon2 - $lon1;
#my $dlat = $lat2 - $lat1;
#my $a = (sin($dlat / 2)) ** 2
# + cos($lat1) * cos($lat2) * (sin($dlon / 2)) ** 2;
#$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
}
elsif($self->{formula} eq 'tv'){
my($a,$b,$f) = (6378137,6356752.3142,1/298.257223563);
my $l = $lon2 - $lon1;
my $u1 = atan((1-$f) * tan($lat1));
my $u2 = atan((1-$f) * tan($lat2));
my $sin_u1 = sin($u1); my $cos_u1 = cos($u1);
lib/Geo/Distance.pm view on Meta::CPAN
my $delta_sigma = $bb*$sin_sigma*($cos2sigma_m+$bb/4*($cos_sigma*(-1+2*$cos2sigma_m*$cos2sigma_m)-
$bb/6*$cos2sigma_m*(-3+4*$sin_sigma*$sin_sigma)*(-3+4*$cos2sigma_m*$cos2sigma_m)));
$c = ( $b*$aa*($sigma-$delta_sigma) ) / $self->{units}->{meter};
}
else{
croak('Unkown distance formula "'.$self->{formula}.'"');
}
return $unit * $c;
}
lib/Geo/Distance.pm view on Meta::CPAN
=head1 SYNOPSIS
use Geo::Distance;
my $geo = new Geo::Distance;
$geo->formula('hsin');
$geo->reg_unit( 'toad_hop', 200120 );
$geo->reg_unit( 'frog_hop' => 6 => 'toad_hop' );
my $distance = $geo->distance( 'unit_type', $lon1,$lat1 => $lon2,$lat2 );
lib/Geo/Distance.pm view on Meta::CPAN
Set this to disable the loading of the default units as described in L</UNITS>.
=head1 ACCESSORS
=head2 formula
if ($geo->formula() eq 'hsin') { ... }
$geo->formula('cos');
Set and get the formula that is currently being used to calculate distances.
See the available L</FORMULAS>.
C<hsin> is the default.
=head1 METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/ECEF.pm view on Meta::CPAN
=head1 DESCRIPTION
Geo::ECEF provides two methods ecef and geodetic. The ecef method calculates the X,Y and Z coordinates in the ECEF (earth centered earth fixed) coordinate system from latitude, longitude and height above the ellipsoid. The geodetic method calculate...
The formulas were found at http://www.u-blox.ch/ and http://waas.stanford.edu/~wwu/maast/maastWWW1_0.zip.
This code is an object Perl rewrite of a similar package by Morten Sickel, Norwegian Radiation Protection Authority
=head1 CONSTRUCTOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Ellipsoids.pm view on Meta::CPAN
my $lat = shift; #radians
die('Error: Latitude (radians) required.') unless defined $lat;
my $a = $self->a;
my $e2 = $self->e2;
return $a * (1-$e2) / ( 1 - $e2 * sin($lat)**2 )**(3/2)
#return $a * (1-$e2) / sqrt(1 - $e2 * sin($lat)**(3/2)); #Bad formula from somewhere
}
=head2 polar_circumference
Method returns the value of the semi-minor axis times 2*PI.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Functions.pm view on Meta::CPAN
return rad_deg(deg_dms(@_));
}
=head2 round
Round to the nearest integer. This formula rounds toward +/- infinity.
my $int = round(42.2);
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/GML/xsd/gml-3.0.0/base/coordinateOperations.xsd view on Meta::CPAN
<element name="methodID" type="gml:IdentifierType">
<annotation>
<documentation>Identification of this operation method. </documentation>
</annotation>
</element>
<element name="formula" type="string">
<annotation>
<documentation>Formula(s) used by this operation method. The value may be a reference to a publication. Note that the operation method may not be analytic, in which case this element references or contains the procedure, not an analytic...
</annotation>
</element>
</sequence>
</extension>
</complexContent>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/GNUPlot.pm view on Meta::CPAN
The radius function is controlled by user defined node values
on a user defined irregular grid. Values between the nodes
are computed using two dimensional linear interpolation. I used
Numerical Recipes in Fortran 77 page 117 equations 3.6.3, 3.6.4, and
3.6.5 as a reference. It is a simple formula and can be derived
from scratch without too much effort. If you don't like this approach
then simply override the radius_function method with your own. Better
yet, provide your improved version to the current maintainer of this
package. In the event Jimmy Carpenter (myself) is still the maintainer,
offer to take over!
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Horizon.pm view on Meta::CPAN
return $self->{'ellipsoid'};
}
=head2 distance
The straight-line of sight distance to the horizon: This formula does not take in account radio or optical refraction which will be further the longer the wavelength.
my $dist=$obj->distance($alt, $lat); #alt in meters (ellipsoid units)
#lat in signed decimal degrees
my $dist=$obj->distance($alt); #default lat => 0 (equator)
my $dist=$obj->distance; #default alt => 1.7
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Index.pm view on Meta::CPAN
print "$$closest{name}\n"; # Also prints 'South Pole'
($farthest) = $index->Farthest( [ 90, 0 ] );
print "$$farthest{name}\n"; # Also prints 'South Pole'
# Compute distance in meters between two points (using haversine formula)
$m = $index->Distance( { lat=>51.507222, lon=>-0.1275 }, [ -6.2, 106.816667 ] );
printf("London to Jakarta: %i km\n", $m / 1000);
$index->DistanceFrom( [ 90, 0 ] );
lib/Geo/Index.pm view on Meta::CPAN
circumference assuming a spherical (not an oblate) body.
=item *
B<C<search_result_distance>> - Distance (in meters) of point from search
point of previous search. The distance computation assumes a spherical body
and is computed using a ruggedized version of the haversine formula. This
value is only generated when C<L<Search(...)|/Search( ... )>> is called with the C<radius>
or C<sort_results> option. See also C<L<Distance(...)|/Distance( ... )>>, C<L<DistanceFrom(...)|/DistanceFrom( ... )>>,
and C<L<DistanceTo(...)|/DistanceTo( ... )>>.
=item *
B<C<antipode_distance>> - Distance (in meters) of point from search
point's antipode as determined by a previous call to C<L<Farthest(...)|/Farthest( ... )>>.
This distance is computed using a ruggedized version of the haversine formula.
=back
As a convenience, most methods allow points to be specified using a shorthand
notation S<C<[ I<lat>, I<lon> ]>> or S<C<[ I<lat>, I<lon>, I<data> ]>>. Points
lib/Geo/Index.pm view on Meta::CPAN
#. Distance functions
#.
#. Geo::Index uses the haversine formula to compute great circle distances
#. between points.
#.
#. Three versions are supported: a fallback version written in Perl (used if the
#. C versions fail to compile) and two accelerated versions written in C, one
#. using floats and the other using doubles. By default the C float version is
lib/Geo/Index.pm view on Meta::CPAN
( $sin_lon_diff_over_2 * $sin_lon_diff_over_2 )
* $DistanceFrom_cos_lat_1
* cos( $lat_0 )
);
#. The haversine formula may get messy around antipodal points so clip to the largest sane value.
if ( $n < 0.0 ) { $n = 0.0; }
return $DistanceFrom_diameter * asin( sqrt($n) );
}
lib/Geo/Index.pm view on Meta::CPAN
is not done then the distance values from the first search may be overwritten by
those of the subsequent searches.
=item *
Geo::Index uses the spherical haversine formula to compute distances. While
quite fast, its accuracy over long distances is poor, with a worst case error
of about 0.1% (22 km). Since the module already has provision for changing the
backends used for the distance methods, adding a new backend to, for example,
compute accurate distances on e.g. a WGS-84 spheroid would be simple and
straight-forward.
view all matches for this distribution
view release on metacpan or search on metacpan
will fail on.
* Calculate Heat Index and/or Wind Chill
Both would be fairly easy to do, provided you get the formulas
correct. (Those vary around the world!)
If you'd like to submit a patch for any of these, please let me know!
Please put 'METAR' in the subject of your e-mail.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/MedianCenter/XS.pm view on Meta::CPAN
longitude in decimal degrees.
=item haversine_distance_dec($lat1, $lon1, $lat2, $long2)
Computes the distance between the two points using the Haversine
formula in meters. Latitude and longitude are specified in decimal
degrees.
=item haversine_distance_rad($lat1, $lon1, $lat2, $long2)
Computes the distance between the two points using the Haversine
formula in meters. Latitude and longitude are specified in radians.
=back
=head2 EXPORT
view all matches for this distribution
view release on metacpan or search on metacpan
longitude are the same. This only holds true at the equator;
otherwise the distance between two degrees longitude is:
cos($lat*PI/180)*LON_MILEAGE_CONSTANT
This formula is probably well-known, but I got it from:
http://www.malaysiagis.com/related_technologies/mapping/basics1b.cfm
This corrected a bug where the cells searched would often miss
areas that were a ways away from the site.
view all matches for this distribution
view release on metacpan or search on metacpan
longitude are the same. This only holds true at the equator;
otherwise the distance between two degrees longitude is:
cos($lat*PI/180)*LON_MILEAGE_CONSTANT
This formula is probably well-known, but I got it from:
http://www.malaysiagis.com/related_technologies/mapping/basics1b.cfm
This corrected a bug where the cells searched would often miss
areas that were a ways away from the site.
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Geo::Query.
0.04 08 Jul 2010
- Fixed distance formula for southern hemisphere
0.03 Mon Feb 11 07:42:42 CET 2008
- Calculates distances.
view all matches for this distribution
view release on metacpan or search on metacpan
This program was developed to be able to calculate the position between two GPS fixes using a 2-dimensional 3rd order polynomial spline.
f(t) = A + B(t-t0) + C(t-t0)^2 + D(t-t0)^3 #position in X and Y
f'(t) = B + 2C(t-t0) + 3D(t-t0)^2 #velocity in X and Y
I did some simple Math (for an engineer with a math minor) to come up with these formulas to calculate the unknowns from our knowns.
A = x0 # when (t-t0)=0 in f(t)
B = v0 # when (t-t0)=0 in f'(t)
C = (x1-A-B(t1-t0)-D(t1-t0)^3)/(t1-t0)^2 # solve for C from f(t)
C = (v1-B-3D(t1-t0)^2)/2(t1-t0) # solve for C from f'(t)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/WeatherNWS.pm view on Meta::CPAN
$Report->{windchill_f} # Wind Chill (degrees f)
$Report->{windchill_c} # Wind Chill (degrees c)
$Report->{heat_index_f} # Heat Index (degrees f)
$Report->{heat_index_c} # Heat Index (degrees c)
Note: Due to the formulas used to get the heat index and windchill,
sometimes these values are a little strange. A check to see if the
heat index is above the temperature before displaying it would be
a good thing for you to do. You probably don't want to display
the windchill unless its cold either.
view all matches for this distribution
view release on metacpan or search on metacpan
maxmind-db/MaxMind-DB-spec.md view on Meta::CPAN
This key is optional. However, creators of databases are strongly
encouraged to include a description in at least one language.
### Calculating the Search Tree Section Size
The formula for calculating the search tree section size *in bytes* is as
follows:
( ( $record_size * 2 ) / 8 ) * $number_of_nodes
The end of the search tree marks the beginning of the data section.
maxmind-db/MaxMind-DB-spec.md view on Meta::CPAN
then it is an actual pointer value pointing into the data section. The value
of the pointer is relative to the start of the data section, *not* the
start of the file.
In order to determine where in the data section we should start looking, we use
the following formula:
$data_section_offset = ( $record_value - $node_count ) - 16
The 16 is the size of the data section separator. We subtract it because we
want to permit pointing to the first byte of the data section. Recall that
maxmind-db/MaxMind-DB-spec.md view on Meta::CPAN
is a *node number*, and we look up that node. If a record contains a value
greater than or equal to 1,016, we know that it is a data section value. We
subtract the node count (1,000) and then subtract 16 for the data section
separator, giving us the number 0, the first byte of the data section.
If a record contained the value 6,000, this formula would give us an offset of
4,984 into the data section.
In order to determine where in the file this offset really points to, we also
need to know where the data section starts. This can be calculated by
determining the size of the search tree in bytes and then adding an additional
maxmind-db/MaxMind-DB-spec.md view on Meta::CPAN
$offset_in_file = $data_section_offset
+ $search_tree_size_in_bytes
+ 16
Since we subtract and then add 16, the final formula to determine the
offset in the file can be simplified to:
$offset_in_file = ( $record_value - $node_count )
+ $search_tree_size_in_bytes
view all matches for this distribution