The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

  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');
                                    # ¡ÖËÌ¡×

DESCRIPTION

Create

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);

Fields

Startpoint, Endpoint, diretion, distance is the fields of this object.

from_point

Return the Startpoint as Location::GeoTool object.

to_point

Return the Endpoint as Location::GeoTool object.

direction

Return the direction from Standpoint to Endpoint by degree between 0 and 360. Start from North (0) and East is positive.

distance

Return the distance between Startpoint to Endpoint, by [m].

Methods

reverse

Return a new Location::GeoTool::Direction object which reverse Startpoint to Endpoint, Endpoint ... and so on.

pivot

  $newobj = $dirobj->pivot($rot,$pow);

Return a new Location::GeoTool::Direction object, which is rotate around Startpoint and extend distance $pow times powered.

dir_string

  $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.

DEPENDENCIES

Math::Trig

SEE ALSO

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

AUTHOR

OHTSUKA Ko-hei, <nene@kokogiko.net>

COPYRIGHT AND LICENSE

Copyright (C) 2004-2007 by Kokogiko!,

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 170:

Non-ASCII character seen before =encoding in '[¡ë]'. Assuming CP1252