
Location::GeoTool::Direction - Perl extention to handle direction/distance

use Location::GeoTool;
# Create
$locobj = Location::GeoTool->create_coord('353924.491','1394010.478','wgs84','dmsn');
$dirobj = $locobj->direction_point('403614.307','1410133.022','wgs84','dmsn');
# Fields
$dir = $dirobj->direction; # 11.8035750... [¡ë]
$dist = $dirobj->distance; # 561836.65713... [m]
$start = $dirobj->from_point; # '353924.491','1394010.478','wgs84','dmsn'¤Î
Location::GeoTool¥ª¥Ö¥¸¥§¥¯¥È
$end = $dirobj->to_point; # '403614.307','1410133.022','wgs84','dmsn'¤Î...
# Methods
$revobj = $dirobj->reverse; # »ÏÅÀ <-> ½ªÅÀ
$midpoint = $dirobj->pivot(0,0.5);# ÃæÅÀ
$dirstr = $dirobj->dir_string(4,'jp');
# ¡ÖËÌ¡×

Created by methods of Location::GeoTool.
$dirobj = $locobj->direction_point('403614.307','1410133.022','wgs84','dmsn');
$dirobj = $locobj->direction_point($another_locobj);
$dirobj = $locobj->direction_vector(120,500);
Startpoint, Endpoint, diretion, distance is the fields of this object.
Return the Startpoint as Location::GeoTool object.
Return the Endpoint as Location::GeoTool object.
Return the direction from Standpoint to Endpoint by degree between 0 and 360. Start from North (0) and East is positive.
Return the distance between Startpoint to Endpoint, by [m].
Return a new Location::GeoTool::Direction object which reverse Startpoint to Endpoint, Endpoint ... and so on.
$newobj = $dirobj->pivot($rot,$pow);
Return a new Location::GeoTool::Direction object, which is rotate around Startpoint and extend distance $pow times powered.
$dirstr = $dirobj->dir_string($denom,$lang);
Return the direction name of direction. $denom specifies the all number of direction names. (4,8,16,32) $lang is the language of name. ('jp','en')
Example of $denom:
In case $dirobj->direction => 241 $dirobj->dir_string(4,'en') => 'W' $dirobj->dir_string(8,'en') => 'SW' $dirobj->dir_string(16,'en') => 'WSW' $dirobj->dir_string(32,'en') => 'SWbW'
Character code of Japanese is EUC.

Math::Trig

Support this module in Kokogiko web site : http://kokogiko.net/

OHTSUKA Ko-hei, <kotsuka@spacetag.jp>

Copyright (C) 2004 by SpaceTag INC.,
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.