⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ribboniterator.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
字号:
/** *                     RESTRICTED RIGHTS LEGEND * *                        BBNT Solutions LLC *                        A Verizon Company *                        10 Moulton Street *                       Cambridge, MA 02138 *                         (617) 873-3000 * * Copyright BBNT Solutions LLC 2001, 2002 All Rights Reserved * */package com.bbn.openmap.geo;/** * Iterate along a sequence of Ribbons. A Ribbon is a three Geo set, * with a RIGHT, CENTER and LEFT Geo in the Ribbon. The location of * the LEFT and RIGHT Geo are perpendicular to the great circle path * that the CENTER Geo resides on. */public class RibbonIterator {    protected Geo v1;    protected Geo v2;    protected double radius;    protected Geo gc;    protected Rotation rotator;    protected Geo point;    protected double distance;    protected boolean hasNext;    /**     * Return an iterator that returns Ribbons along the great circle     * between v1 and v2. The Ribbon points are radius radians appart,     * and each Ribbon is 2*radius appart.     */    public RibbonIterator(Geo v1, Geo v2, double radius) {        this.v1 = v1;        this.v2 = v2;        this.distance = v1.distance(v2);        this.radius = radius;        this.gc = v1.crossNormalize(v2);        this.rotator = new Rotation(gc, 2.0 * radius);        this.point = v1;        this.hasNext = true;    }    public Object next() {        if (point != v2 && v1.distance(point) < distance) {            Ribbon result = new Ribbon(point, gc, radius);            point = rotator.rotate(point);            return result;        } else {            point = v2;            return new Ribbon(point, gc, radius);        }    }    public boolean hasNext() {        return point != v2;    }    public void remove() {}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -