Class: Geom::LatLong

Inherits:
Object
  • Object
show all

Overview

The LatLong class contains various methods for creating and manipulating latitude and longitude coordinates.

Version:

  • SketchUp 6.0

Instance Method Summary # collapse

Constructor Details

#initializeGeom::LatLong #initialize(latlong) ⇒ Geom::LatLong #initialize(latlong_array) ⇒ Geom::LatLong #initialize(lat, long) ⇒ Geom::LatLong

The new method creates a LatLong object.

Examples:

# No arguments, creates a latlong with (0, 0)
latlong1 = Geom::LatLong.new

latlong2 = Geom::LatLong.new(40.01700, 105.28300)

array = [40.01700, 105.28300]
latlong3 = Geom::LatLong.new(array)

Overloads:

Version:

  • SketchUp 6.0

Instance Method Details

#latitudeFloat

The Latitude method retrieves the latitude coordinate from a LatLong object.

Examples:

latlong = Geom::LatLong.new(40.01700, 105.28300)
# The result is 40.01700
latitude = latlong.latitude

Returns:

  • (Float)

    a latitude coordinate value

Version:

  • SketchUp 6.0

#longitudeFloat

The Latitude method retrieves the longitude coordinate from a LatLong object.

Examples:

latlong = Geom::LatLong.new(40.01700, 105.28300)
# The result is 105.28300
longitude = latlong.longitude

Returns:

  • (Float)

    a latitude coordinate value

Version:

  • SketchUp 6.0

#to_aArray(Float, Float)

The #to_a method converts a LatLong object to an array of two values.

Examples:

latlong = Geom::LatLong.new(40.01700, 105.28300)
array = latlong.to_a

Returns:

  • (Array(Float, Float))

    an array of latitude and longitude

Version:

  • SketchUp 6.0

#to_sString

The #to_s method converts a LatLong object to a String.

Examples:

latlong = Geom::LatLong.new([40.01700, 105.28300])
string = latlong.to_s

Returns:

Version:

  • SketchUp 6.0

#to_utmGeom::UTM

The to_utm method converts a LatLong object to a UTM object.

Examples:

latlong = Geom::LatLong.new(40.01700, 105.28300)
# The result is UTM(48 T 524150.82056 4429682.40743)
utm = latlong.to_utm

Returns:

Version:

  • SketchUp 6.0