polar
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 23
Polar 1.4
Polar provides a smooth and simple cursor set created primarily in Inkscape. more>>
Polar provides a smooth and simple cursor set created primarily in Inkscape.
Polar Cursor Theme is a smooth and simple cursor set created primarily in Inkscape.
Installation
There are three cursor sets included in this package. The default with the orange busy cursors is called PolarCursorTheme and the blue and green variants have -Blue and -Green added to the end of their theme name. To make sure that all themes are installed (or only the one you want) extract to /.icons/ in your home folder.
Note
KDE users please note that installing the cursors through the control center can cause some cursors to use the default X cursors. To fix this simply extract the theme directly to /.icons/ in your home folder.
Finally a special thanks to all the authors of various cursor themes here on gnome-look.org for ideas.
Enhancements:
- Added Zoom cursors
- Fixes to cursor mappings
- Highlight added to clean up outlines
- Added Blue and Green busy cursors as an option
- Changed move cursor
- Small changes to other cursors
<<lessPolar Cursor Theme is a smooth and simple cursor set created primarily in Inkscape.
Installation
There are three cursor sets included in this package. The default with the orange busy cursors is called PolarCursorTheme and the blue and green variants have -Blue and -Green added to the end of their theme name. To make sure that all themes are installed (or only the one you want) extract to /.icons/ in your home folder.
Note
KDE users please note that installing the cursors through the control center can cause some cursors to use the default X cursors. To fix this simply extract the theme directly to /.icons/ in your home folder.
Finally a special thanks to all the authors of various cursor themes here on gnome-look.org for ideas.
Enhancements:
- Added Zoom cursors
- Fixes to cursor mappings
- Highlight added to clean up outlines
- Added Blue and Green busy cursors as an option
- Changed move cursor
- Small changes to other cursors
Download (MB)
Added: 2007-03-02 License: GPL (GNU General Public License) Price:
975 downloads
PHP Polar Tools 0.4
PHP Polar Tools is a set of PHP classes for the parsing and management of Polar Heart Rate Monitor data. more>>
PHP Polar Tools project is a set of PHP classes that can parse and manage the Polar Heart Rate Monitor data.
<<less Download (MB)
Added: 2007-04-21 License: GPL (GNU General Public License) Price:
916 downloads
PolarViewer 1.3.1
PolarViewer is a viewer application for exercise files recorded with Polar heartrate monitors. more>>
PolarViewer is a viewer application for exercise files recorded with Polar heartrate monitors. PolarViewer project displays all the recorded exercise data (except power) and creates diagrams.
If you want to organize your exercises and create statistics you should use the SportsTracker application together with PolarViewer.
This is a compatibility list for heartrate monitors:
Polar S610(i) (tested)
Polar S710(i) (tested)
Polar S720i (tested)
Polar S725 (tested)
Polar S625x (tested, HRM files only)
Polar S410 (tested, HRM files only)
Other Polar monitors might work too, but I cant test them. User feedback is welcome.
Its also possible to view HRM exercise files (recorded with the Polar Software for Windows) with PolarViewer.
The application itself is not able to receive the exercise files from the Polar device and store it on the computer. Theres an excellent tool called s710 (written by Dave Bailey) which does this job.
<<lessIf you want to organize your exercises and create statistics you should use the SportsTracker application together with PolarViewer.
This is a compatibility list for heartrate monitors:
Polar S610(i) (tested)
Polar S710(i) (tested)
Polar S720i (tested)
Polar S725 (tested)
Polar S625x (tested, HRM files only)
Polar S410 (tested, HRM files only)
Other Polar monitors might work too, but I cant test them. User feedback is welcome.
Its also possible to view HRM exercise files (recorded with the Polar Software for Windows) with PolarViewer.
The application itself is not able to receive the exercise files from the Polar device and store it on the computer. Theres an excellent tool called s710 (written by Dave Bailey) which does this job.
Download (0.20MB)
Added: 2006-03-12 License: GPL (GNU General Public License) Price:
1324 downloads
GD::Graph::Polar 0.15
GD::Graph::Polar is a Perl module to make polar graph using GD package. more>>
GD::Graph::Polar is a Perl module to make polar graph using GD package.
SYNOPSIS
use GD::Graph::Polar;
my $obj=GD::Graph::Polar->new(size=>480, radius=>100);
$obj->addPoint (50=>25);
$obj->addPoint_rad (50=>3.1415);
$obj->addGeoPoint (75=>25);
$obj->addGeoPoint_rad (75=>3.1415);
$obj->addLine($r0=>$t0, $r1=>$t1);
$obj->addLine_rad($r0=>$t0, $r1=>$t1);
$obj->addGeoLine($r0=>$t0, $r1=>$t1);
$obj->addGeoLine_rad($r0=>$t0, $r1=>$t1);
$obj->addArc($r0=>$t0, $r1=>$t1);
$obj->addArc_rad($r0=>$t0, $r1=>$t1);
$obj->addGeoArc($r0=>$t0, $r1=>$t1);
$obj->addGeoArc_rad($r0=>$t0, $r1=>$t1);
$obj->addString($r=>$t, "Hello World!");
$obj->addString_rad($r=>$t, "Hello World!");
$obj->addGeoString($r=>$t, "Hello World!");
$obj->addGeoString_rad($r=>$t, "Hello World!");
$obj->font(gdSmallFont); #sets the current font from GD exports
$obj->color("blue"); #sets the current color from Graphics::ColorNames
$obj->color([0,0,0]); #sets the current color [red,green,blue]
print $obj->draw;
<<lessSYNOPSIS
use GD::Graph::Polar;
my $obj=GD::Graph::Polar->new(size=>480, radius=>100);
$obj->addPoint (50=>25);
$obj->addPoint_rad (50=>3.1415);
$obj->addGeoPoint (75=>25);
$obj->addGeoPoint_rad (75=>3.1415);
$obj->addLine($r0=>$t0, $r1=>$t1);
$obj->addLine_rad($r0=>$t0, $r1=>$t1);
$obj->addGeoLine($r0=>$t0, $r1=>$t1);
$obj->addGeoLine_rad($r0=>$t0, $r1=>$t1);
$obj->addArc($r0=>$t0, $r1=>$t1);
$obj->addArc_rad($r0=>$t0, $r1=>$t1);
$obj->addGeoArc($r0=>$t0, $r1=>$t1);
$obj->addGeoArc_rad($r0=>$t0, $r1=>$t1);
$obj->addString($r=>$t, "Hello World!");
$obj->addString_rad($r=>$t, "Hello World!");
$obj->addGeoString($r=>$t, "Hello World!");
$obj->addGeoString_rad($r=>$t, "Hello World!");
$obj->font(gdSmallFont); #sets the current font from GD exports
$obj->color("blue"); #sets the current color from Graphics::ColorNames
$obj->color([0,0,0]); #sets the current color [red,green,blue]
print $obj->draw;
Download (0.046MB)
Added: 2007-04-24 License: Perl Artistic License Price:
547 downloads
GIS::Distance::Polar 0.01001
GIS::Distance::Polar can do Polar coordinate flat-earth distance calculations. more>>
GIS::Distance::Polar can do Polar coordinate flat-earth distance calculations.
SYNOPSIS
my $calc = GIS::Distance::Polar->new();
my $distance = $calc->distance( $lon1, $lat1 => $lon2, $lat2 );
Supposedly this is a formula to better calculate distances at the poles.
While implimented, this formula has not been tested much. If you use it PLEASE share your results with the author.
FORMULA
a = pi/2 - lat1
b = pi/2 - lat2
c = sqrt( a^2 + b^2 - 2 * a * b * cos(lon2 - lon1) )
d = R * c
METHODS
distance
my $distance = $calc->distance( $lon1, $lat1 => $lon2, $lat2 );
This method accepts two lat/lon sets (in decimal degrees) and returns a Class::Measure::Length object containing the distance between the two points.
<<lessSYNOPSIS
my $calc = GIS::Distance::Polar->new();
my $distance = $calc->distance( $lon1, $lat1 => $lon2, $lat2 );
Supposedly this is a formula to better calculate distances at the poles.
While implimented, this formula has not been tested much. If you use it PLEASE share your results with the author.
FORMULA
a = pi/2 - lat1
b = pi/2 - lat2
c = sqrt( a^2 + b^2 - 2 * a * b * cos(lon2 - lon1) )
d = R * c
METHODS
distance
my $distance = $calc->distance( $lon1, $lat1 => $lon2, $lat2 );
This method accepts two lat/lon sets (in decimal degrees) and returns a Class::Measure::Length object containing the distance between the two points.
Download (0.008MB)
Added: 2007-08-07 License: Perl Artistic License Price:
808 downloads
Polar Jukebox System 0.6.0.57
The Polar Jukebox System (PJS) is a set of curses and console applications that allow you to manage huge amounts of MP3 files. more>>
The Polar Jukebox System (PJS) is a set of curses and console applications that allow you to manage huge amounts of MP3 files. It stores all information in a PostgreSQL database for fast and reliable acces.
The reason I started this project is that I always wanted a easy-to-use music collection, and I reached that goal with the PJS. I started programming in late 1998 and kept programming from time to time. Now I think the PJS is ready for the public, even not everything that is possible has been done - but it works!
The PJS runs under the GPL (GNU Public License) an can be installed on computers running Debian GNU/Linux, other distributions are not supported till now, and I still need help for packing the PJS to others dists.
Main features:
- Riping/encoding of audio CDs (with CDDB support) into the PJS with jrec
- Easy management of a big CD Collections with jplay
- Playlistgeneration and -management
- Automatic playlists (alltime charts, newcomers, rarely played...)
- Special play modes (random, linear...)
- Export of CDs to CD-R
- Database (postgresql) storage of the track and CD information
<<lessThe reason I started this project is that I always wanted a easy-to-use music collection, and I reached that goal with the PJS. I started programming in late 1998 and kept programming from time to time. Now I think the PJS is ready for the public, even not everything that is possible has been done - but it works!
The PJS runs under the GPL (GNU Public License) an can be installed on computers running Debian GNU/Linux, other distributions are not supported till now, and I still need help for packing the PJS to others dists.
Main features:
- Riping/encoding of audio CDs (with CDDB support) into the PJS with jrec
- Easy management of a big CD Collections with jplay
- Playlistgeneration and -management
- Automatic playlists (alltime charts, newcomers, rarely played...)
- Special play modes (random, linear...)
- Export of CDs to CD-R
- Database (postgresql) storage of the track and CD information
Download (0.14MB)
Added: 2006-07-26 License: GPL (GNU General Public License) Price:
680 downloads
KmPlot 1.2.0
KmPlot is a mathematical function plotter for the KDE desktop. more>>
KmPlot 1.2.0 offers a software which has features of a mathematical function plotter for the KDE desktop. KmPlot is a mathematical function plotter for the KDE desktop. It has built in a powerful parser. You can plot different functions simultaneously and combine their function terms to build new functions.
KmPlot supports functions with parameters and functions in polar coordinates. Several grid modes are possible. Plots may be printed with high precision in correct scale.
Major Features:
- Powerful mathematical parser
- Precise metric printing
- Different plot types (functions, parametric, polar)
- Highly configurable visual settings (plot line, axes, grid)
- Export to bitmap format (BMP and PNG) and scalable vector graphics (SVG)
- Save/load complete session in readable xml format
- Trace mode: cross hair following plot, coordinates shown in the status bar
- Support zooming
- Ability to draw the 1st and 2nd derivative and the integral of a plot function
- Support user defined constants and parameter values
- Various tools for plot functions: find minimum/maximum point, get y-value and draw the area between the function and the y-axis
Requirements: KDE 4
Added: 2008-06-11 License: GPL Price: FREE
12 downloads
Other version of KmPlot
License:GPL (GNU General Public License)
SportsTracker 2.5.1
SportsTracker is an application for recording sporting activities. more>>
SportsTracker is an application for people which want to record their sporting activities. SportsTracker is not bound to a specific kind of sport, the user can create categories for all sport types which are endurance related, such as cycling, running or swimming.
The main advantage is a good overview of your exercises and you can easily create diagrams and statistics for specific time ranges and sport types.
If you own a heartrate monitor with a computer interface you can organize the recorded exercise files by attaching them to the exercise entries and view them on demand. You can also import the data from the exercise files. Users of a Polar device should install PolarViewer for this feature.
All the application data is stored in XML files. So it should be easy to access it with other tools or to write importers and exporters for other applications.
<<lessThe main advantage is a good overview of your exercises and you can easily create diagrams and statistics for specific time ranges and sport types.
If you own a heartrate monitor with a computer interface you can organize the recorded exercise files by attaching them to the exercise entries and view them on demand. You can also import the data from the exercise files. Users of a Polar device should install PolarViewer for this feature.
All the application data is stored in XML files. So it should be easy to access it with other tools or to write importers and exporters for other applications.
Download (0.28MB)
Added: 2007-06-04 License: GPL (GNU General Public License) Price:
878 downloads
KChart 1.6.1
KChart is the KOffice chart drawing application. more>>
KChart is the KOffice chart drawing application part of the KOffice suite. Use it to embed charts into your KOffice documents, e.g. a report written with KWord or a slideshow made with KPresenter.
Main features:
Easy to Use:
- default values for all parameters
- automatic ordinate axis computation based on highest/lowest data value
- default sizes (fonts, line widths...) relative to the window size
Highly Configurable:
- All of the parameters may be changed after configuring/drawing the chart.
- Size values (axis/grid line width, font sizes, bar width, dataset gap, pie chart radius ... ) may be specified in either absolute pixels or relative to the window size. This makes your chart layout-independent since such values are being recalculated automatically when the window dimensions have changed.
Flexible Layout:
- Legends may be centered at a chart edge or in a corner with the chart making way in vertical and/or in horizontal direction thus offering 16 legend/chart relationships to choose from
- Header and footer texts have special font type/size and color settings
Axes and Data:
- Automatical ordinate axis computation based on highest/lowest data value which can be easily replaced by programmer-defined start, end and delta value settings.
- Abscissa labels may be taken either from data cells containing the respective strings or from programmer-defined QStringLists or calculated automatically based on a format chosen by the user and values found in the cells
- Up to 8 axes: 2 left, 2 right, 2 top, 2 bottom
- A chart may have 2 different ordinates: e.g. left axis for series 1,2,3 right axis for data series 4
- Each axis may draw (sub-)grid lines using their own color, line width, style
Chart Combinations:
- sharing the same abscissa axis or using different ones (e.g Top and Bottom axis)
- sharing the same ordinate or using different ones (e.g Left and Right axis)
- Axes may use the same line color / line width as the bars (or the lines, resp.) which they belong to.
Chart Types:
- Bar: normal | stacked | percent, 2D | 3D-Look
- Line: normal | stacked | percent, 2D | 3D-Look, show marker: circle | square | diamond
- Area: normal | stacked | percent
- HiLo: normal | open-close
- Pie: normal | exploded | some exploded, 2D | 3D
- Ring: normal | exploded | some exploded, fixed thickness | relative thickness
- Polar: normal | stacked | percent
<<lessMain features:
Easy to Use:
- default values for all parameters
- automatic ordinate axis computation based on highest/lowest data value
- default sizes (fonts, line widths...) relative to the window size
Highly Configurable:
- All of the parameters may be changed after configuring/drawing the chart.
- Size values (axis/grid line width, font sizes, bar width, dataset gap, pie chart radius ... ) may be specified in either absolute pixels or relative to the window size. This makes your chart layout-independent since such values are being recalculated automatically when the window dimensions have changed.
Flexible Layout:
- Legends may be centered at a chart edge or in a corner with the chart making way in vertical and/or in horizontal direction thus offering 16 legend/chart relationships to choose from
- Header and footer texts have special font type/size and color settings
Axes and Data:
- Automatical ordinate axis computation based on highest/lowest data value which can be easily replaced by programmer-defined start, end and delta value settings.
- Abscissa labels may be taken either from data cells containing the respective strings or from programmer-defined QStringLists or calculated automatically based on a format chosen by the user and values found in the cells
- Up to 8 axes: 2 left, 2 right, 2 top, 2 bottom
- A chart may have 2 different ordinates: e.g. left axis for series 1,2,3 right axis for data series 4
- Each axis may draw (sub-)grid lines using their own color, line width, style
Chart Combinations:
- sharing the same abscissa axis or using different ones (e.g Top and Bottom axis)
- sharing the same ordinate or using different ones (e.g Left and Right axis)
- Axes may use the same line color / line width as the bars (or the lines, resp.) which they belong to.
Chart Types:
- Bar: normal | stacked | percent, 2D | 3D-Look
- Line: normal | stacked | percent, 2D | 3D-Look, show marker: circle | square | diamond
- Area: normal | stacked | percent
- HiLo: normal | open-close
- Pie: normal | exploded | some exploded, 2D | 3D
- Ring: normal | exploded | some exploded, fixed thickness | relative thickness
- Polar: normal | stacked | percent
Download (55.4MB)
Added: 2006-12-04 License: GPL (GNU General Public License) Price:
1058 downloads
Ympyris 0.9.4
Ympyris project is a circular falling blocks game. more>>
Ympyris project is a circular falling blocks game.
Ympyris is a falling blocks game that uses a circle instead of a rectangular grid.
Ympyris is a game that combines the idea of Tetris to the polar coordinate system. In normal Tetris-clones you move the falling blocks left and right. In Ympyris you rotate the well to find a place for the falling block.
<<lessYmpyris is a falling blocks game that uses a circle instead of a rectangular grid.
Ympyris is a game that combines the idea of Tetris to the polar coordinate system. In normal Tetris-clones you move the falling blocks left and right. In Ympyris you rotate the well to find a place for the falling block.
Download (MB)
Added: 2006-12-07 License: GPL (GNU General Public License) Price:
1052 downloads
pyglplot 0.1.0
pyglplot is an interactive 3D plotting and visualization tool written as a Python module that uses OpenGL and the GIMP Toolkit. more>>
pyglplot is a program to 3D-plot mathematical functions and datafiles. It is written as a module for python and as such features the full power and flexibility of the python programming language.
Main features:
Data Sources
- Plot python functions
- Plot python dictionaries containing the coordinates of the points and their position in the grid
- Plot plain datafiles as understood for example by gnuplot
Graphics
- Can make 3D plots of surfaces in normal or parametric mode
- Support coordinate transforms, i.e. can make e.g. polar plots
- Support for pm3d-style coloring of the surface
- Support for wireframe plotting atop of the surface
- Support for transparency: translucent plots
- Support for different types of fog and arbitrary background colors
- Support for dynamic light and specular reflexes etc.
- Use either perspective projection or parallel projection
- Save the rendered plots as portable network graphics (.png)
- Adjust all graphics parameters via dialog windows
Platforms
- This program is developed and tested on Max OS X 10.4 on powerpc with fink and Debian GNU/Linux on i386. It should compile and run everywhere where its prerequisites and requisites thereof are available. These are gtkglext-1.0 and gthread-2.0. Some minimum versions of the libriaries must be met, unfortunately, the gtk+-2.2 packages provided by fink for Mac OS X 10.3 are not sufficient -- perhaps I will port it there.
<<lessMain features:
Data Sources
- Plot python functions
- Plot python dictionaries containing the coordinates of the points and their position in the grid
- Plot plain datafiles as understood for example by gnuplot
Graphics
- Can make 3D plots of surfaces in normal or parametric mode
- Support coordinate transforms, i.e. can make e.g. polar plots
- Support for pm3d-style coloring of the surface
- Support for wireframe plotting atop of the surface
- Support for transparency: translucent plots
- Support for different types of fog and arbitrary background colors
- Support for dynamic light and specular reflexes etc.
- Use either perspective projection or parallel projection
- Save the rendered plots as portable network graphics (.png)
- Adjust all graphics parameters via dialog windows
Platforms
- This program is developed and tested on Max OS X 10.4 on powerpc with fink and Debian GNU/Linux on i386. It should compile and run everywhere where its prerequisites and requisites thereof are available. These are gtkglext-1.0 and gthread-2.0. Some minimum versions of the libriaries must be met, unfortunately, the gtk+-2.2 packages provided by fink for Mac OS X 10.3 are not sufficient -- perhaps I will port it there.
Download (0.23MB)
Added: 2005-08-05 License: GPL (GNU General Public License) Price:
1542 downloads
Antiprism 0.15
Antiprism is a suite of programs for the generation, manipulation, and visualisation of polyhedra. more>>
Antiprism project is a suite of programs for the generation, manipulation, and visualisation of polyhedra.
Make a cube
This can be done with unipoly, which can be used to make all the uniform polyhedra.
unipoly cube > cube.off
Display with
off2pov -o cube.pov cube.off
povray +a +p cube.pov
Make the dual octahedron
pol_recip is used for making duals by polar reciprocation.
To make a nice compound the radius of the sphere used for reciprocation needs to be the distance from the cube centre to the mid-point of an edge, and the sphere centre must be the centre of the cube.
unipoly has centred the cube on (0, 0, 0), which is the default centre for pol_recip. The radius can be specified using the -R option and passing two adjacent vertex index numbers of the cube. Use off2pov with the -n option to display the cube with its vertex numbers.
off2pov -x vf -n -o cube.pov cube.off
povray +a +p cube.pov
Vertices 3 and 5 are adjacent, so make the dual octahedron like this, and display it.
pol_recip -R 3,5 cube.off > oct.off
off2pov -o oct.pov oct.off
povray +a +p oct.pov
Merge the polyhedra
OFF files are merged with off_merge
off_util cube.off oct.off > cub_oct.off
Display the result.
off2pov -o cub_oct.pov cub_oct.off
povray +a +p cub_oct.pov
Use colours
To make it clearer that this is a compound of a cube and octahedron the two polyhedra could be given different colours using off_color.
Colour the cube faces red, and the octahedron faces green.
off_color -f 1,0,0 cube.off > red_cube.off
off_color -f 0,1,0 oct.off > green_oct.off
Now merge and display as before, this time making the edge and vertex elements smaller than the defaults
off_util red_cube.off green_oct.off > color_cub_oct.off
off2pov -v 0.02 -e 0.016 -o color_cub_oct.pov color_cub_oct.off
povray +a +p color_cub_oct.pov
Enhancements:
- Edge handling has been improved.
- The GLU tesselator is used for all polygon tesselation, making polygon display more consistent in export formats.
- The minimum enclosing ball is used for camera positioning, allowing better use of screen space.
- Special duals can be calculated automatically.
- There is a new program which spirals points on a sphere, and another which arranges points in rings on a sphere.
<<lessMake a cube
This can be done with unipoly, which can be used to make all the uniform polyhedra.
unipoly cube > cube.off
Display with
off2pov -o cube.pov cube.off
povray +a +p cube.pov
Make the dual octahedron
pol_recip is used for making duals by polar reciprocation.
To make a nice compound the radius of the sphere used for reciprocation needs to be the distance from the cube centre to the mid-point of an edge, and the sphere centre must be the centre of the cube.
unipoly has centred the cube on (0, 0, 0), which is the default centre for pol_recip. The radius can be specified using the -R option and passing two adjacent vertex index numbers of the cube. Use off2pov with the -n option to display the cube with its vertex numbers.
off2pov -x vf -n -o cube.pov cube.off
povray +a +p cube.pov
Vertices 3 and 5 are adjacent, so make the dual octahedron like this, and display it.
pol_recip -R 3,5 cube.off > oct.off
off2pov -o oct.pov oct.off
povray +a +p oct.pov
Merge the polyhedra
OFF files are merged with off_merge
off_util cube.off oct.off > cub_oct.off
Display the result.
off2pov -o cub_oct.pov cub_oct.off
povray +a +p cub_oct.pov
Use colours
To make it clearer that this is a compound of a cube and octahedron the two polyhedra could be given different colours using off_color.
Colour the cube faces red, and the octahedron faces green.
off_color -f 1,0,0 cube.off > red_cube.off
off_color -f 0,1,0 oct.off > green_oct.off
Now merge and display as before, this time making the edge and vertex elements smaller than the defaults
off_util red_cube.off green_oct.off > color_cub_oct.off
off2pov -v 0.02 -e 0.016 -o color_cub_oct.pov color_cub_oct.off
povray +a +p color_cub_oct.pov
Enhancements:
- Edge handling has been improved.
- The GLU tesselator is used for all polygon tesselation, making polygon display more consistent in export formats.
- The minimum enclosing ball is used for camera positioning, allowing better use of screen space.
- Special duals can be calculated automatically.
- There is a new program which spirals points on a sphere, and another which arranges points in rings on a sphere.
Download (3.2MB)
Added: 2007-06-23 License: MIT/X Consortium License Price:
915 downloads
GD::Simple 2.35
GD::Simple module is a simplified interface to GD library. more>>
GD::Simple module is a simplified interface to GD library.
SYNOPSIS
use GD::Simple;
# create a new image
$img = GD::Simple->new(400,250);
# draw a red rectangle with blue borders
$img->bgcolor(red);
$img->fgcolor(blue);
$img->rectangle(10,10,50,50);
# draw an empty rectangle with green borders
$img->bgcolor(undef);
$img->fgcolor(green);
$img->rectangle(30,30,100,100);
# move to (80,80) and draw a green line to (100,190)
$img->moveTo(80,80);
$img->lineTo(100,190);
# draw a solid orange ellipse
$img->moveTo(110,100);
$img->bgcolor(orange);
$img->fgcolor(orange);
$img->ellipse(40,40);
# draw a black filled arc
$img->moveTo(150,150);
$img->fgcolor(black);
$img->arc(50,50,0,100,gdNoFill|gdEdged);
# draw a string at (10,180) using the default
# built-in font
$img->moveTo(10,180);
$img->string(This is very simple);
# draw a string at (280,210) using 20 point
# times italic, angled upward 90 degrees
$img->moveTo(280,210);
$img->font(Times:italic);
$img->fontsize(20);
$img->angle(-90);
$img->string(This is very fancy);
# some turtle graphics
$img->moveTo(300,100);
$img->penSize(3,3);
$img->angle(0);
$img->line(20); # 20 pixels going to the right
$img->turn(30); # set turning angle to 30 degrees
$img->line(20); # 20 pixel line
$img->line(20);
$img->line(20);
$img->turn(-90); # set turning angle to -90 degrees
$img->line(50); # 50 pixel line
# draw a cyan polygon edged in blue
my $poly = new GD::Polygon;
$poly->addPt(150,100);
$poly->addPt(199,199);
$poly->addPt(100,199);
$img->bgcolor(cyan);
$img->fgcolor(blue);
$img->penSize(1,1);
$img->polygon($poly);
# convert into png data
print $img->png;
GD::Simple is a subclass of the GD library that shortens many of the long GD method calls by storing information about the pen color, size and position in the GD object itself. It also adds a small number of "turtle graphics" style calls for those who prefer to work in polar coordinates. In addition, the library allows you to use symbolic names for colors, such as "chartreuse", and will manage the colors for you.
The Pen
GD::Simple maintains a "pen" whose settings are used for line- and shape-drawing operations. The pen has the following properties:
fgcolor
The pen foreground color is the color of lines and the borders of filled and unfilled shapes.
bgcolor
The pen background color is the color of the contents of filled shapes.
pensize
The pen size is the width of the pen. Larger sizes draw thicker lines.
position
The pen position is its current position on the canvas in (X,Y) coordinates.
angle
When drawing in turtle mode, the pen angle determines the current direction of lines of relative length.
turn
When drawing in turtle mode, the turn determines the clockwise or counterclockwise angle that the pen will turn before drawing the next line.
font
The font to use when drawing text. Both built-in bitmapped fonts and TrueType fonts are supported.
fontsize
The size of the font to use when drawing with TrueType fonts.
One sets the position and properties of the pen and then draws. As the drawing progresses, the position of the pen is updated.
Methods
GD::Simple introduces a number of new methods, a few of which have the same name as GD::Image methods, and hence change their behavior. In addition to these new methods, GD::Simple objects support all of the GD::Image methods. If you make a method call that isnt directly supported by GD::Simple, it refers the request to the underlying GD::Image object. Hence one can load a JPEG image into GD::Simple and declare it to be TrueColor by using this call, which is effectively inherited from GD::Image:
my $img = GD::Simple->newFromJpeg(./myimage.jpg,1);
The rest of this section describes GD::Simple-specific methods.
$img->moveTo($x,$y)
This call changes the position of the pen without drawing. It moves the pen to position ($x,$y) on the drawing canvas.
$img->move($dx,$dy)
$img->move($dr)
This call changes the position of the pen without drawing. When called with two arguments it moves the pen $dx pixels to the right and $dy pixels downward. When called with one argument it moves the pen $dr pixels along the vector described by the current pen angle.
$img->lineTo($x,$y)
The lineTo() call simultaneously draws and moves the pen. It draws a line from the current pen position to the position defined by ($x,$y) using the current pen size and color. After drawing, the position of the pen is updated to the new position.
$img->line($dx,$dy)
$img->line($dr)
The line() call simultaneously draws and moves the pen. When called with two arguments it draws a line from the current position of the pen to the position $dx pixels to the right and $dy pixels down. When called with one argument, it draws a line $dr pixels long along the angle defined by the current pen angle.
$img->clear
This method clears the canvas by painting over it with the current background color.
$img->rectangle($x1,$y1,$x2,$y2)
This method draws the rectangle defined by corners ($x1,$y1), ($x2,$y2). The rectangles edges are drawn in the foreground color and its contents are filled with the background color. To draw a solid rectangle set bgcolor equal to fgcolor. To draw an unfilled rectangle (transparent inside), set bgcolor to undef.
$img->ellipse($width,$height)
This method draws the ellipse centered at the current location with width $width and height $height. The ellipses border is drawn in the foreground color and its contents are filled with the background color. To draw a solid ellipse set bgcolor equal to fgcolor. To draw an unfilled ellipse (transparent inside), set bgcolor to undef.
$img->arc($cx,$cy,$width,$height,$start,$end [,$style])
This method draws filled and unfilled arcs. See GD for a description of the arguments. To draw a solid arc (such as a pie wedge) set bgcolor equal to fgcolor. To draw an unfilled arc, set bgcolor to undef.
$img->polygon($poly)
This method draws filled and unfilled polygon using the current settings of fgcolor for the polygon border and bgcolor for the polygon fill color. See GD for a description of creating polygons. To draw a solid polygon set bgcolor equal to fgcolor. To draw an unfilled polygon, set bgcolor to undef.
$img->polyline($poly)
This method draws polygons without closing the first and last vertices (similar to GD::Image->unclosedPolygon()). It uses the fgcolor to draw the line.
$img->string($string)
This method draws the indicated string starting at the current position of the pen. The pen is moved to the end of the drawn string. Depending on the font selected with the font() method, this will use either a bitmapped GD font or a TrueType font. The angle of the pen will be consulted when drawing the text. For TrueType fonts, any angle is accepted. For GD bitmapped fonts, the angle can be either 0 (draw horizontal) or -90 (draw upwards).
For consistency between the TrueType and GD font behavior, the string is always drawn so that the current position of the pen corresponds to the bottom left of the first character of the text. This is different from the GD behavior, in which the first character of bitmapped fonts hangs down from the pen point.
This method returns a polygon indicating the bounding box of the rendered text. If an error occurred (such as invalid font specification) it returns undef and an error message in $@.
$metrics = $img->fontMetrics
($metrics,$width,$height) = GD::Simple->fontMetrics($font,$fontsize,$string)
This method returns information about the current font, most commonly a TrueType font. It can be invoked as an instance method (on a previously-created GD::Simple object) or as a class method (on the GD::Simple class).
When called as an instance method, fontMetrics() takes no arguments and returns a single hash reference containing the metrics that describe the currently selected font and size. The hash reference contains the following information:
xheight the base height of the font from the bottom to the top of
a lowercase m
ascent the length of the upper stem of the lowercase d
descent the length of the lower step of the lowercase j
lineheight the distance from the bottom of the j to the top of
the d
leading the distance between two adjacent lines
($delta_x,$delta_y)= $img->stringBounds($string)
This method indicates the X and Y offsets (which may be negative) that will occur when the given string is drawn using the current font, fontsize and angle. When the string is drawn horizontally, it gives the width and height of the strings bounding box.
$delta_x = $img->stringWidth($string)
This method indicates the width of the string given the current font, fontsize and angle. It is the same as ($img->stringBounds($string))[0]
($x,$y) = $img->curPos
Return the current position of the pen. Set the current position using moveTo().
$font = $img->font([$newfont] [,$newsize])
Get or set the current font. Fonts can be GD::Font objects, TrueType font file paths, or fontconfig font patterns like "Times:italic" (see fontconfig). The latter feature requires that you have the fontconfig library installed and are using libgd version 2.0.33 or higher.
As a shortcut, you may pass two arguments to set the font and the fontsize simultaneously. The fontsize is only valid when drawing with TrueType fonts.
$size = $img->fontsize([$newfontsize])
Get or set the current font size. This is only valid for TrueType fonts.
$size = $img->penSize([$newpensize])
Get or set the current pen width for use during line drawing operations.
$angle = $img->angle([$newangle])
Set the current angle for use when calling line() or move() with a single argument.
Here is an example of using turn() and angle() together to draw an octagon. The first line drawn is the downward-slanting top right edge. The last line drawn is the horizontal top of the octagon.
$img->moveTo(200,50);
$img->angle(0);
$img->turn(360/8);
for (1..8) { $img->line(50) }
$angle = $img->turn([$newangle])
Get or set the current angle to turn prior to drawing lines. This value is only used when calling line() or move() with a single argument. The turning angle will be applied to each call to line() or move() just before the actual drawing occurs.
Angles are in degrees. Positive values turn the angle clockwise.
$color = $img->fgcolor([$newcolor])
Get or set the pens foreground color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$color = $img->bgcolor([$newcolor])
Get or set the pens background color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$index = $img->translate_color(@args)
Translates a color into a GD palette or TrueColor index. You may pass either an (r,g,b) triple or a symbolic color name. If you pass a previously-allocated index, the method will return it unchanged.
$index = $img->alphaColor(@args,$alpha)
Creates an alpha color. You may pass either an (r,g,b) triple or a symbolic color name, followed by an integer indicating its opacity. The opacity value ranges from 0 (fully opaque) to 127 (fully transparent).
@names = GD::Simple->color_names
$translate_table = GD::Simple->color_names
Called in a list context, color_names() returns the list of symbolic color names recognized by this module. Called in a scalar context, the method returns a hash reference in which the keys are the color names and the values are array references containing [r,g,b] triples.
$gd = $img->gd
Return the internal GD::Image object. Usually you will not need to call this since all GD methods are automatically referred to this object.
($red,$green,$blue) = GD::Simple->HSVtoRGB($hue,$saturation,$value)
Convert a Hue/Saturation/Value (HSV) color into an RGB triple. The hue, saturation and value are integers from 0 to 255.
($hue,$saturation,$value) = GD::Simple->RGBtoHSV($hue,$saturation,$value)
Convert a Red/Green/Blue (RGB) value into a Hue/Saturation/Value (HSV) triple. The hue, saturation and value are integers from 0 to 255.
COLORS
This script will create an image showing all the symbolic colors.
#!/usr/bin/perl
use strict;
use GD::Simple;
my @color_names = GD::Simple->color_names;
my $cols = int(sqrt(@color_names));
my $rows = int(@color_names/$cols)+1;
my $cell_width = 100;
my $cell_height = 50;
my $legend_height = 16;
my $width = $cols * $cell_width;
my $height = $rows * $cell_height;
my $img = GD::Simple->new($width,$height);
$img->font(gdSmallFont);
for (my $c=0; $cfgcolor($color);
$img->rectangle(@topleft,@botright);
$img->moveTo($topleft[0]+2,$botright[1]+$legend_height-2);
$img->fgcolor(black);
$img->string($color);
}
}
print $img->png;
<<lessSYNOPSIS
use GD::Simple;
# create a new image
$img = GD::Simple->new(400,250);
# draw a red rectangle with blue borders
$img->bgcolor(red);
$img->fgcolor(blue);
$img->rectangle(10,10,50,50);
# draw an empty rectangle with green borders
$img->bgcolor(undef);
$img->fgcolor(green);
$img->rectangle(30,30,100,100);
# move to (80,80) and draw a green line to (100,190)
$img->moveTo(80,80);
$img->lineTo(100,190);
# draw a solid orange ellipse
$img->moveTo(110,100);
$img->bgcolor(orange);
$img->fgcolor(orange);
$img->ellipse(40,40);
# draw a black filled arc
$img->moveTo(150,150);
$img->fgcolor(black);
$img->arc(50,50,0,100,gdNoFill|gdEdged);
# draw a string at (10,180) using the default
# built-in font
$img->moveTo(10,180);
$img->string(This is very simple);
# draw a string at (280,210) using 20 point
# times italic, angled upward 90 degrees
$img->moveTo(280,210);
$img->font(Times:italic);
$img->fontsize(20);
$img->angle(-90);
$img->string(This is very fancy);
# some turtle graphics
$img->moveTo(300,100);
$img->penSize(3,3);
$img->angle(0);
$img->line(20); # 20 pixels going to the right
$img->turn(30); # set turning angle to 30 degrees
$img->line(20); # 20 pixel line
$img->line(20);
$img->line(20);
$img->turn(-90); # set turning angle to -90 degrees
$img->line(50); # 50 pixel line
# draw a cyan polygon edged in blue
my $poly = new GD::Polygon;
$poly->addPt(150,100);
$poly->addPt(199,199);
$poly->addPt(100,199);
$img->bgcolor(cyan);
$img->fgcolor(blue);
$img->penSize(1,1);
$img->polygon($poly);
# convert into png data
print $img->png;
GD::Simple is a subclass of the GD library that shortens many of the long GD method calls by storing information about the pen color, size and position in the GD object itself. It also adds a small number of "turtle graphics" style calls for those who prefer to work in polar coordinates. In addition, the library allows you to use symbolic names for colors, such as "chartreuse", and will manage the colors for you.
The Pen
GD::Simple maintains a "pen" whose settings are used for line- and shape-drawing operations. The pen has the following properties:
fgcolor
The pen foreground color is the color of lines and the borders of filled and unfilled shapes.
bgcolor
The pen background color is the color of the contents of filled shapes.
pensize
The pen size is the width of the pen. Larger sizes draw thicker lines.
position
The pen position is its current position on the canvas in (X,Y) coordinates.
angle
When drawing in turtle mode, the pen angle determines the current direction of lines of relative length.
turn
When drawing in turtle mode, the turn determines the clockwise or counterclockwise angle that the pen will turn before drawing the next line.
font
The font to use when drawing text. Both built-in bitmapped fonts and TrueType fonts are supported.
fontsize
The size of the font to use when drawing with TrueType fonts.
One sets the position and properties of the pen and then draws. As the drawing progresses, the position of the pen is updated.
Methods
GD::Simple introduces a number of new methods, a few of which have the same name as GD::Image methods, and hence change their behavior. In addition to these new methods, GD::Simple objects support all of the GD::Image methods. If you make a method call that isnt directly supported by GD::Simple, it refers the request to the underlying GD::Image object. Hence one can load a JPEG image into GD::Simple and declare it to be TrueColor by using this call, which is effectively inherited from GD::Image:
my $img = GD::Simple->newFromJpeg(./myimage.jpg,1);
The rest of this section describes GD::Simple-specific methods.
$img->moveTo($x,$y)
This call changes the position of the pen without drawing. It moves the pen to position ($x,$y) on the drawing canvas.
$img->move($dx,$dy)
$img->move($dr)
This call changes the position of the pen without drawing. When called with two arguments it moves the pen $dx pixels to the right and $dy pixels downward. When called with one argument it moves the pen $dr pixels along the vector described by the current pen angle.
$img->lineTo($x,$y)
The lineTo() call simultaneously draws and moves the pen. It draws a line from the current pen position to the position defined by ($x,$y) using the current pen size and color. After drawing, the position of the pen is updated to the new position.
$img->line($dx,$dy)
$img->line($dr)
The line() call simultaneously draws and moves the pen. When called with two arguments it draws a line from the current position of the pen to the position $dx pixels to the right and $dy pixels down. When called with one argument, it draws a line $dr pixels long along the angle defined by the current pen angle.
$img->clear
This method clears the canvas by painting over it with the current background color.
$img->rectangle($x1,$y1,$x2,$y2)
This method draws the rectangle defined by corners ($x1,$y1), ($x2,$y2). The rectangles edges are drawn in the foreground color and its contents are filled with the background color. To draw a solid rectangle set bgcolor equal to fgcolor. To draw an unfilled rectangle (transparent inside), set bgcolor to undef.
$img->ellipse($width,$height)
This method draws the ellipse centered at the current location with width $width and height $height. The ellipses border is drawn in the foreground color and its contents are filled with the background color. To draw a solid ellipse set bgcolor equal to fgcolor. To draw an unfilled ellipse (transparent inside), set bgcolor to undef.
$img->arc($cx,$cy,$width,$height,$start,$end [,$style])
This method draws filled and unfilled arcs. See GD for a description of the arguments. To draw a solid arc (such as a pie wedge) set bgcolor equal to fgcolor. To draw an unfilled arc, set bgcolor to undef.
$img->polygon($poly)
This method draws filled and unfilled polygon using the current settings of fgcolor for the polygon border and bgcolor for the polygon fill color. See GD for a description of creating polygons. To draw a solid polygon set bgcolor equal to fgcolor. To draw an unfilled polygon, set bgcolor to undef.
$img->polyline($poly)
This method draws polygons without closing the first and last vertices (similar to GD::Image->unclosedPolygon()). It uses the fgcolor to draw the line.
$img->string($string)
This method draws the indicated string starting at the current position of the pen. The pen is moved to the end of the drawn string. Depending on the font selected with the font() method, this will use either a bitmapped GD font or a TrueType font. The angle of the pen will be consulted when drawing the text. For TrueType fonts, any angle is accepted. For GD bitmapped fonts, the angle can be either 0 (draw horizontal) or -90 (draw upwards).
For consistency between the TrueType and GD font behavior, the string is always drawn so that the current position of the pen corresponds to the bottom left of the first character of the text. This is different from the GD behavior, in which the first character of bitmapped fonts hangs down from the pen point.
This method returns a polygon indicating the bounding box of the rendered text. If an error occurred (such as invalid font specification) it returns undef and an error message in $@.
$metrics = $img->fontMetrics
($metrics,$width,$height) = GD::Simple->fontMetrics($font,$fontsize,$string)
This method returns information about the current font, most commonly a TrueType font. It can be invoked as an instance method (on a previously-created GD::Simple object) or as a class method (on the GD::Simple class).
When called as an instance method, fontMetrics() takes no arguments and returns a single hash reference containing the metrics that describe the currently selected font and size. The hash reference contains the following information:
xheight the base height of the font from the bottom to the top of
a lowercase m
ascent the length of the upper stem of the lowercase d
descent the length of the lower step of the lowercase j
lineheight the distance from the bottom of the j to the top of
the d
leading the distance between two adjacent lines
($delta_x,$delta_y)= $img->stringBounds($string)
This method indicates the X and Y offsets (which may be negative) that will occur when the given string is drawn using the current font, fontsize and angle. When the string is drawn horizontally, it gives the width and height of the strings bounding box.
$delta_x = $img->stringWidth($string)
This method indicates the width of the string given the current font, fontsize and angle. It is the same as ($img->stringBounds($string))[0]
($x,$y) = $img->curPos
Return the current position of the pen. Set the current position using moveTo().
$font = $img->font([$newfont] [,$newsize])
Get or set the current font. Fonts can be GD::Font objects, TrueType font file paths, or fontconfig font patterns like "Times:italic" (see fontconfig). The latter feature requires that you have the fontconfig library installed and are using libgd version 2.0.33 or higher.
As a shortcut, you may pass two arguments to set the font and the fontsize simultaneously. The fontsize is only valid when drawing with TrueType fonts.
$size = $img->fontsize([$newfontsize])
Get or set the current font size. This is only valid for TrueType fonts.
$size = $img->penSize([$newpensize])
Get or set the current pen width for use during line drawing operations.
$angle = $img->angle([$newangle])
Set the current angle for use when calling line() or move() with a single argument.
Here is an example of using turn() and angle() together to draw an octagon. The first line drawn is the downward-slanting top right edge. The last line drawn is the horizontal top of the octagon.
$img->moveTo(200,50);
$img->angle(0);
$img->turn(360/8);
for (1..8) { $img->line(50) }
$angle = $img->turn([$newangle])
Get or set the current angle to turn prior to drawing lines. This value is only used when calling line() or move() with a single argument. The turning angle will be applied to each call to line() or move() just before the actual drawing occurs.
Angles are in degrees. Positive values turn the angle clockwise.
$color = $img->fgcolor([$newcolor])
Get or set the pens foreground color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$color = $img->bgcolor([$newcolor])
Get or set the pens background color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$index = $img->translate_color(@args)
Translates a color into a GD palette or TrueColor index. You may pass either an (r,g,b) triple or a symbolic color name. If you pass a previously-allocated index, the method will return it unchanged.
$index = $img->alphaColor(@args,$alpha)
Creates an alpha color. You may pass either an (r,g,b) triple or a symbolic color name, followed by an integer indicating its opacity. The opacity value ranges from 0 (fully opaque) to 127 (fully transparent).
@names = GD::Simple->color_names
$translate_table = GD::Simple->color_names
Called in a list context, color_names() returns the list of symbolic color names recognized by this module. Called in a scalar context, the method returns a hash reference in which the keys are the color names and the values are array references containing [r,g,b] triples.
$gd = $img->gd
Return the internal GD::Image object. Usually you will not need to call this since all GD methods are automatically referred to this object.
($red,$green,$blue) = GD::Simple->HSVtoRGB($hue,$saturation,$value)
Convert a Hue/Saturation/Value (HSV) color into an RGB triple. The hue, saturation and value are integers from 0 to 255.
($hue,$saturation,$value) = GD::Simple->RGBtoHSV($hue,$saturation,$value)
Convert a Red/Green/Blue (RGB) value into a Hue/Saturation/Value (HSV) triple. The hue, saturation and value are integers from 0 to 255.
COLORS
This script will create an image showing all the symbolic colors.
#!/usr/bin/perl
use strict;
use GD::Simple;
my @color_names = GD::Simple->color_names;
my $cols = int(sqrt(@color_names));
my $rows = int(@color_names/$cols)+1;
my $cell_width = 100;
my $cell_height = 50;
my $legend_height = 16;
my $width = $cols * $cell_width;
my $height = $rows * $cell_height;
my $img = GD::Simple->new($width,$height);
$img->font(gdSmallFont);
for (my $c=0; $cfgcolor($color);
$img->rectangle(@topleft,@botright);
$img->moveTo($topleft[0]+2,$botright[1]+$legend_height-2);
$img->fgcolor(black);
$img->string($color);
}
}
print $img->png;
Download (0.25MB)
Added: 2007-07-23 License: Perl Artistic License Price:
825 downloads
Geo::Distance 0.11
Geo::Distance is a Perl module that can calculate distances and closest locations. more>>
Geo::Distance is a Perl module that can calculate distances and closest locations.
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 );
my $locations = $geo->closest(
dbh => $dbh,
table => $table,
lon => $lon,
lat => $lat,
unit => $unit_type,
distance => $dist_in_unit
);
This perl library aims to provide as many tools to make it as simple as possible to calculate distances between geographic points, and anything that can be derived from that. Currently there is support for finding the closest locations within a specified distance, to find the closest number of points to a specified point, and to do basic point-to-point distance calculations.
METHODS
new
my $geo = new Geo::Distance;
my $geo = new Geo::Distance( no_units=>1 );
Returns a blessed Geo::Distance object. The new constructor accepts one optional argument.
no_units - Whether or not to load the default units. Defaults to 0 (false).
kilometer, kilometre, meter, metre, centimeter, centimetre, millimeter,
millimetre, yard, foot, inch, light second, mile, nautical mile,
poppy seed, barleycorn, rod, pole, perch, chain, furlong, league,
fathom
formula
if($geo->formula eq hsin){ ... }
$geo->formula(cos);
Allows you to retrieve and set the formula that is currently being used to calculate distances. The availabel formulas are hsin, polar, cos, and mt. hsin is the default and mt/cos are depreciated in favor of hsin. polar should be used when calculating coordinates near the poles.
reg_unit
$geo->reg_unit( $radius, $key );
$geo->reg_unit( $key1 => $key2 );
$geo->reg_unit( $count1, $key1 => $key2 );
$geo->reg_unit( $key1 => $count2, $key2 );
$geo->reg_unit( $count1, $key1 => $count2, $key2 );
This method is used to create custom unit types. There are several ways of calling it, depending on if you are defining the unit from scratch, or if you are basing it off of an existing unit (such as saying 12 inches = 1 foot ). When defining a unit from scratch you pass the name and rho (radius of the earth in that unit) value.
So, if you wanted to do your calculations in human adult steps you would have to have an average human adult walk from the crust of the earth to the core (ignore the fact that this is impossible). So, assuming we did this and we came up with 43,200 steps, youd do something like the following.
# Define adult step unit.
$geo->reg_unit( 43200, adult step );
# This can be read as "It takes 43,200 adult_steps to walk the radius of the earth".
Now, if you also wanted to do distances in baby steps you might think "well, now I gotta get a baby to walk to the center of the earth". But, you dont have to! If you do some research youll find (no research was actually conducted) that there are, on average, 4.7 baby steps in each adult step.
# Define baby step unit.
$geo->reg_unit( 4.7, baby step => adult step );
# This can be read as "4.7 baby steps is the same as one adult step".
And if we were doing this in reverse and already had the baby step unit but not the adult step, you would still use the exact same syntax as above.
distance
my $distance = $geo->distance( unit_type, $lon1,$lat1 => $lon2,$lat2 );
Calculates the distance between two lon/lat points.
closest
my $locations = $geo->closest(
dbh => $dbh,
table => $table,
lon => $lon,
lat => $lat,
unit => $unit_type,
distance => $dist_in_unit
);
This method finds the closest locations within a certain distance and returns an array reference with a hash for each location matched.
The closest method requires the following arguments:
dbh - a DBI database handle
table - a table within dbh that contains the locations to search
lon - the longitude of the center point
lat - the latitude of the center point
unit - the unit of measurement to use, such as "meter"
distance - the distance, in units, from the center point to find locations
The following arguments are optional:
lon_field - the name of the field in the table that contains the longitude, defaults to "lon"
lat_field - the name of the field in the table that contains the latitude, defaults to "lat"
fields - an array reference of extra field names that you would like returned with each location
where - additional rules for the where clause of the sql
bind - an array reference of bind variables to go with the placeholders in where
sort - whether to sort the locations by their distance, making the closest location the first returned
count - return at most these number of locations (implies sort => 1)
This method uses some very simplistic calculations to SQL select out of the dbh. This means that the SQL should work fine on almost any database (only tested on MySQL and SQLite so far) and this also means that it is fast. Once this sub set of locations has been retrieved then more precise calculations are made to narrow down the result set. Remember, though, that the farther out your distance is, and the more locations in the table, the slower your searches will be.
<<lessSYNOPSIS
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 );
my $locations = $geo->closest(
dbh => $dbh,
table => $table,
lon => $lon,
lat => $lat,
unit => $unit_type,
distance => $dist_in_unit
);
This perl library aims to provide as many tools to make it as simple as possible to calculate distances between geographic points, and anything that can be derived from that. Currently there is support for finding the closest locations within a specified distance, to find the closest number of points to a specified point, and to do basic point-to-point distance calculations.
METHODS
new
my $geo = new Geo::Distance;
my $geo = new Geo::Distance( no_units=>1 );
Returns a blessed Geo::Distance object. The new constructor accepts one optional argument.
no_units - Whether or not to load the default units. Defaults to 0 (false).
kilometer, kilometre, meter, metre, centimeter, centimetre, millimeter,
millimetre, yard, foot, inch, light second, mile, nautical mile,
poppy seed, barleycorn, rod, pole, perch, chain, furlong, league,
fathom
formula
if($geo->formula eq hsin){ ... }
$geo->formula(cos);
Allows you to retrieve and set the formula that is currently being used to calculate distances. The availabel formulas are hsin, polar, cos, and mt. hsin is the default and mt/cos are depreciated in favor of hsin. polar should be used when calculating coordinates near the poles.
reg_unit
$geo->reg_unit( $radius, $key );
$geo->reg_unit( $key1 => $key2 );
$geo->reg_unit( $count1, $key1 => $key2 );
$geo->reg_unit( $key1 => $count2, $key2 );
$geo->reg_unit( $count1, $key1 => $count2, $key2 );
This method is used to create custom unit types. There are several ways of calling it, depending on if you are defining the unit from scratch, or if you are basing it off of an existing unit (such as saying 12 inches = 1 foot ). When defining a unit from scratch you pass the name and rho (radius of the earth in that unit) value.
So, if you wanted to do your calculations in human adult steps you would have to have an average human adult walk from the crust of the earth to the core (ignore the fact that this is impossible). So, assuming we did this and we came up with 43,200 steps, youd do something like the following.
# Define adult step unit.
$geo->reg_unit( 43200, adult step );
# This can be read as "It takes 43,200 adult_steps to walk the radius of the earth".
Now, if you also wanted to do distances in baby steps you might think "well, now I gotta get a baby to walk to the center of the earth". But, you dont have to! If you do some research youll find (no research was actually conducted) that there are, on average, 4.7 baby steps in each adult step.
# Define baby step unit.
$geo->reg_unit( 4.7, baby step => adult step );
# This can be read as "4.7 baby steps is the same as one adult step".
And if we were doing this in reverse and already had the baby step unit but not the adult step, you would still use the exact same syntax as above.
distance
my $distance = $geo->distance( unit_type, $lon1,$lat1 => $lon2,$lat2 );
Calculates the distance between two lon/lat points.
closest
my $locations = $geo->closest(
dbh => $dbh,
table => $table,
lon => $lon,
lat => $lat,
unit => $unit_type,
distance => $dist_in_unit
);
This method finds the closest locations within a certain distance and returns an array reference with a hash for each location matched.
The closest method requires the following arguments:
dbh - a DBI database handle
table - a table within dbh that contains the locations to search
lon - the longitude of the center point
lat - the latitude of the center point
unit - the unit of measurement to use, such as "meter"
distance - the distance, in units, from the center point to find locations
The following arguments are optional:
lon_field - the name of the field in the table that contains the longitude, defaults to "lon"
lat_field - the name of the field in the table that contains the latitude, defaults to "lat"
fields - an array reference of extra field names that you would like returned with each location
where - additional rules for the where clause of the sql
bind - an array reference of bind variables to go with the placeholders in where
sort - whether to sort the locations by their distance, making the closest location the first returned
count - return at most these number of locations (implies sort => 1)
This method uses some very simplistic calculations to SQL select out of the dbh. This means that the SQL should work fine on almost any database (only tested on MySQL and SQLite so far) and this also means that it is fast. Once this sub set of locations has been retrieved then more precise calculations are made to narrow down the result set. Remember, though, that the farther out your distance is, and the more locations in the table, the slower your searches will be.
Download (0.010MB)
Added: 2007-07-24 License: Perl Artistic License Price:
824 downloads
Engauge Digitizer 4.1
Engauge Digitizer converts graph and map images into numbers. more>>
Engauge Digitizer project is digitizing software that converts an image showing a graph or map into numbers. The image file can come from a scanner, digital camera, or screenshot. The numbers can be read on the screen, and written or copied to a spreadsheet.
Highlights for beginners include an intuitive interface and extensive context-sensitive documentation. Highlights for experts include compensation for image distortion, cartesian and polar coordinates, linear and logarithmic coordinates, automatic scanning, graphical previews, and browser help.
<<lessHighlights for beginners include an intuitive interface and extensive context-sensitive documentation. Highlights for experts include compensation for image distortion, cartesian and polar coordinates, linear and logarithmic coordinates, automatic scanning, graphical previews, and browser help.
Download (9.1MB)
Added: 2007-04-25 License: GPL (GNU General Public License) Price:
924 downloads
Secleted [ 0 ] software to compare
- Page: 1 of 2
- 1
- 2
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above polar search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed