Giter Club home page Giter Club logo

coordinate-transformer-rs's Introduction

coordinate-transformer-rs

Provides functions to convert geocentric Cartesian coordinates, latitude and longitude, plane rectangular coordinates, and pixel coordinates. It also defines a structure to represent each coordinate value.

地心直交座標、緯度経度、平面直角座標、ピクセル座標の変換を行う関数を提供する。 また、それぞれの座標値を表すための構造体も定義している。

使い方

fn example() {
    use coordinate_transformer_rs::*;

    // Conversion from plane rectangular coordinates to longitude and latitude.
    // 平面直角座標から緯経度への変換
    let (long, lat) = jpr2ll((22694.980, 11573.375), JprOrigin::Nine);

    // Conversion from longitude and latitude to plane rectangular coordinates.
    // 緯経度から平面直角座標への変換
    let (y, x) = ll2jpr(
        (
            140.08785504166664_f64.to_radians(),
            36.103774791666666_f64.to_radians(),
        ),
        JprOrigin::Nine,
    );

    // Conversion from longitude and latitude to pixel coordinates.
    // 緯経度からピクセル座標への変換
    let (x, y) = ll2pixel(
        (139.7649308_f64.to_radians(), 35.6812405_f64.to_radians()),
        ZoomLv::Lv21,
    );

    // Coordinate transformations using structures
    // 構造体を使用した座標変換
    let ll = LL::new(140_f64.to_radians(), 36_f64.to_radians());
    let jpr = ll.to_jpr(JprOrigin::Nine);
    let pixel = ll.to_pixel(ZoomLv::Lv21);
}

ライセンス

Licensed under either of

at your option.

(The English in the README and comments in the source code were translated by DeepL.)

coordinate-transformer-rs's People

Contributors

azishio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.