Package globe. August 29, 2016



Similar documents
Package retrosheet. April 13, 2015

Package sendmailr. February 20, 2015

Package MBA. February 19, Index 7. Canopy LIDAR data

Package empiricalfdr.deseq2

Package uptimerobot. October 22, 2015

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

Package DCG. R topics documented: June 8, Type Package

Package hoarder. June 30, 2015

521493S Computer Graphics. Exercise 2 & course schedule change

Chapter 17. Orthogonal Matrices and Symmetries of Space

Package polynom. R topics documented: June 24, Version 1.3-8

Package LexisPlotR. R topics documented: April 4, Type Package

Package neuralnet. February 20, 2015

Package erp.easy. September 26, 2015

Package png. February 20, 2015

Package plan. R topics documented: February 20, 2015

Package tagcloud. R topics documented: July 3, 2015

Package survpresmooth

Package dunn.test. January 6, 2016

Package sjdbc. R topics documented: February 20, 2015

Package pxr. February 20, 2015

Reef Explorer User Guide

Package MDM. February 19, 2015

Package Formula. April 7, 2015

Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.

Package searchconsoler

Package dsstatsclient

Package benford.analysis

Package syuzhet. February 22, 2015

Package changepoint. R topics documented: November 9, Type Package Title Methods for Changepoint Detection Version 2.

PTC Mathcad Prime 3.0 Keyboard Shortcuts

Package ggrepel. February 8, 2016

Package wordcloud. R topics documented: February 20, 2015

Package gazepath. April 1, 2015

Package rivr. October 16, 2015

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

Package EstCRM. July 13, 2015

Package SHELF. February 5, 2016

Package CRM. R topics documented: February 19, 2015

x = + x 2 + x

Package R4CDISC. September 5, 2015

Package TSfame. February 15, 2013

Package lmertest. July 16, 2015

Getting Started with R and RStudio 1

Package hier.part. February 20, Index 11. Goodness of Fit Measures for a Regression Hierarchy

Geometry of Vectors. 1 Cartesian Coordinates. Carlo Tomasi

Package optirum. December 31, 2015

Package date. R topics documented: February 19, Version Title Functions for handling dates. Description Functions for handling dates.

Package translater. R topics documented: February 20, Type Package

Introduction to GIS (Basics, Data, Analysis) & Case Studies. 13 th May Content. What is GIS?

Package jrvfinance. R topics documented: October 6, 2015

Recall the basic property of the transpose (for any A): v A t Aw = v w, v, w R n.

Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors

Package OECD. R topics documented: January 17, Type Package Title Search and Extract Data from the OECD Version 0.2.

Package httprequest. R topics documented: February 20, 2015

Package saccades. March 18, 2015

11.1. Objectives. Component Form of a Vector. Component Form of a Vector. Component Form of a Vector. Vectors and the Geometry of Space

INTRODUCTION TO RENDERING TECHNIQUES

Package MixGHD. June 26, 2015

Experiment 5: Magnetic Fields of a Bar Magnet and of the Earth

Spatial Data Analysis

Essential Mathematics for Computer Graphics fast

11A Plate Tectonics. What is plate tectonics? Setting up. Materials

Package pesticides. February 20, 2015

Package TRADER. February 10, 2016

Package brewdata. R topics documented: February 19, Type Package

Package COSINE. February 19, 2015

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Package smoothhr. November 9, 2015

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in Total: 175 points.

Reflection and Refraction

Petrel TIPS&TRICKS from SCM

Package bizdays. March 13, 2015

Package bigrf. February 19, 2015

Statistical Data Mining. Practical Assignment 3 Discriminant Analysis and Decision Trees

Celestial Observations

Package hive. January 10, 2011

Package cgdsr. August 27, 2015

Package robfilter. R topics documented: February 20, Version 4.1 Date Title Robust Time Series Filters

Package ChannelAttribution

Package fimport. February 19, 2015

Linear algebra and the geometry of quadratic equations. Similarity transformations and orthogonal matrices

JUST THE MATHS UNIT NUMBER 8.5. VECTORS 5 (Vector equations of straight lines) A.J.Hobson

Package treemap. February 15, 2013

Package BioFTF. February 18, 2016

Package urltools. October 11, 2015

Package StockChina. January 30, 2016

Package DiallelAnalysisR

Package hive. July 3, 2015

Quick and Easy Web Maps with Google Fusion Tables. SCO Technical Paper

Cluster Analysis using R

Exploratory data analysis (Chapter 2) Fall 2011

Fixplot Instruction Manual. (data plotting program)

Package decompr. August 17, 2016

Package missforest. February 20, 2015

Package DSsim. September 25, 2015

Hands on S4 Classes. Yohan Chalabi. R/Rmetrics Workshop Meielisalp June ITP ETH, Zurich Rmetrics Association, Zurich Finance Online, Zurich

Algebra 2 Chapter 1 Vocabulary. identity - A statement that equates two equivalent expressions.

Lecture 8 : Coordinate Geometry. The coordinate plane The points on a line can be referenced if we choose an origin and a unit of 20

GeoGebra. 10 lessons. Gerrit Stols

Transcription:

Type Package Package globe August 29, 2016 Title Plot 2D and 3D Views of the Earth, Including Major Coastline Version 1.1-2 Date 2016-01-29 Maintainer Adrian Baddeley <adrian.baddeley@curtin.edu.au> Depends graphics, stats Basic functions for plotting 2D and 3D views of a sphere, by default the Earth with its major coastline, and additional lines and points. License GPL (>= 2.0) LazyData yes ByteCompile yes NeedsCompilation no Author Adrian Baddeley [aut, cre], Thomas Lawrence [aut] Repository CRAN Date/Publication 2016-02-03 12:26:22 R topics documented: globe-package........................................ 2 cross............................................. 2 dot.............................................. 3 earth............................................. 4 ensure............................................ 4 flatearth........................................... 5 flatpoints.......................................... 6 globedrawlat........................................ 7 globeearth.......................................... 8 globeplot.......................................... 10 orthogproj.......................................... 11 place............................................. 12 runifsphere......................................... 13 spatialpos.......................................... 14 1

2 cross Index 15 globe-package Simple 2D and 3D plots of Spheres including Earth A simple package to plot 2D and 3D views of a sphere. Options include drawing Earth with its major coastline, plotting the lines of longitude and latitude, and plotting points and curves at any locations on the sphere. This package provides very basic tools for plotting lines and points on a sphere. It does not require installation of any other libraries. The major functions are globeearth to plot a 3D view of a sphere (by default the Earth with its major coastline) and flatearth to plot a 2D projection of the sphere. Additional tools include globelines and globepoints to draw lines and points on the sphere. globeearth(eye=place("nedlands"), top=place("northpole")) flatearth(projection="atlas") flatearth(projection="cylindrical") cross Cross Product Computes the cross-product of two vectors in 3D. cross(a, b) a,b Numeric vectors of length 3. Computes the cross product of the two vectors.

dot 3 A vector of length 3 representing the cross product. If the input vectors have length greater than 3, only the first 3 elements will be used in this calculation. dot a <- c(1,0,0) b <- c(0,1,0) cross(a, b) dot Dot Product Computes the dot product of two vectors. dot(a, b) a,b Two vectors of equal length. Vectors can be of any length provided they are equal. A vector of length 1. cross

4 ensure dot(c(2,1),c(-3,4)) earth Major Coastline of Earth Format Source Coordinates of the coastline of continents and major islands on Earth. data("earth") A list with two components: coords is a two-column matrix containing (longitude, latitude) coordinates of the coastline, in degrees; runlen is an integer vector giving the number of vertices for each connected polygon in the coastline. The maps package. data(earth) globeearth(earth$coords, earth$runlen) ensure Checking and converting coordinates This is used as a checking mechanism for other functions to ensure data is given in the appropriate format, and if it is not, converting to the appropriate format where possible. ensure3d(x) ensurelonlat(x) x A vector, matrix or dataframe to be checked

flatearth 5 ensure3d checks to ensure that the given data are one or more sets of 3D Cartesian coordinates, and converts them to numeric vectors if they are not already. If latitudes and longitudes are given as input into ensure3d, they will be converted to 3D Cartesian coordinates, on the unit sphere. ensurelonlat checks to ensure that the given data are one or more pairs of longitude and latitude and converts the data to a pair of lists if they are not already. Vectors and single rows/columns of matrices can be used as input for both functions; multiple rows/colums of matrices and pairs of lists can also be used as input for ensurelonlat. ensure3d A numeric vector or matrix ensurelonlat $lon List of Longitudes spatialpos ensure3d(c(1,4,2)) ensurelonlat(c(-90,145)) flatearth Plot the Earth as a 2D Projection Plots the Earth as specified 2D projection, with a map of the major coastline. flatearth(projection = c("atlas", "cylindrical"), gdata, runlen, asp = NULL,..., do.plot=true) projection gdata runlen The type of 2D projection to be performed. Two-column matrix of latitude, longitude coordinates of coastline vertices. Defaults to earth$coords. If NULL, no coastline is plotted. Integer vector giving the number of vertices in each connected polygon in the coastline. Defaults to earth$runlen.

6 flatpoints asp Optional. Aspect ratio of the longitude and latitude scales.... Optional arguments passed to segments to control the plotting of the coastline. do.plot Logical value indicating whether to actually perform the plotting, or just to return the calculated coordinates. In the atlas projection, the continents are plotted in longitude, latitude coordinates without any correction. In the cylindrical projection, the latitude is transformed so that equal areas on the sphere are transformed onto equal areas on the plot. (Invisibly) a 4-column matrix containing the projected (x, y) coordinates of the segments of the coastline. globeearth. Use flatpoints to plot points on the image. flatearth("atlas") flatearth("cylindrical") flatpoints Plot Points on a 2D Projection of the Earth Plots points on a 2D projection of the Earth created using flatearth, taking into account the projection used. flatpoints(loc, projection = c("atlas", "cylindrical"),..., do.plot)

globedrawlat 7 loc projection A data frame containing latitudes and longitudes of points to be plotted. The projection that was used in creating the 2D image.... Other arguments usually used when plotting points. do.plot Logical value indicating whether to actually perform the plotting, or just to return the calculated coordinates. If the value of projection used in this function is not the one used to create the image, then the points will not be plotted. (Invisibly) a list(x,y) giving the plotted positions of the points. flatearth flatearth("atlas") flatpoints(place("nedlands")) globedrawlat Drawing lines of latitude and longitude These functions respectively draw lines of latitude and longitude on an image of the Earth create using globeearth. globedrawlat(lat, eye = place("nedlands"), top = place("northpole"),...) globedrawlong(lon, eye = place("nedlands"), top = place("northpole"),...)

8 globeearth lat lon eye top A list showing lines of latitude to be drawn A list showing lines of longitude to be drawn Viewpoint. A vector of length 3 determining a position in space. Should take the same value as when invoking globeearth. Vector of length 3 determining a position in space. The plot will be rotated so that this position appears to be directly above the centre of the earth. Should take the same value as when invoking globeearth.... Additional arguments passed to segments to control the plotting of lines. Lines of latitude/longitude are plotted on the existing image. globeearth. Use globepoints to add points to this plot, globelines to add lines to this plot, and globearrows to add arrows to this plot. globeearth() globeearth(eye=place("madrid")) globedrawlat(lat=seq(-90, 90, 15), eye=place("aarhus")) globedrawlong(lon=seq(-180,180,30)) globeearth Plot Earth as 3D Globe Plots the Earth as a 3D sphere, seen from a specified viewpoint, with a map of the major coastline (by default). globeearth(gdata, runlen, eye, top,..., do.plot=true)

globeearth 9 gdata runlen eye top Two-column matrix of latitude, longitude coordinates of coastline vertices. Defaults to earth$coords. If NULL, no coastline is plotted. Integer vector giving the number of vertices in each connected polygon in the coastline. Defaults to earth$runlen. Viewpoint. A vector of length 3 (or a list(lon,lat)) determining a position in space. Vector of length 3 (or a list(lon,lat)) determining a position in space. The plot will be rotated so that this position appears to be directly above the centre of the earth.... passed to segments controlling the plotting of the coastline. do.plot Logical value indicating whether to actually perform the plotting, or just to return the calculated coordinates. The globe is drawn as it would be seen by a viewer at position eye, with the location top at the top of the plot. Only those parts of the coastline that are visible from eye (on the side of the globe facing eye) will be plotted. (Invisibly) a 4-column matrix containing the projected (x, y) coordinates of the segments of the coastline. flatearth. Use globepoints to add points to this plot, globelines to add lines to this plot, globearrows to add arrows to this plot, and globedrawlat or globedrawlong to draw latitude and longitude curves. globeearth() globeearth(eye=place("madrid"))

10 globeplot globeplot Plot points, lines and arrows on a globe Plot points, lines and arrows on an plot of the Earth created by globeearth globepoints(loc, eye=place("nedlands"), top=place("northpole"),..., do.plot=true) globelines(loc, eye=place("nedlands"), top=place("northpole"),..., do.plot=true) globearrows(loc, eye=place("nedlands"), top=place("northpole"), len=0.3,..., do.plot=true) loc eye top len A matrix or list of points to plot (globepoints), draw lines between (globelines) or draw arrows at (globearrows), in order. Viewpoint. A vector of length 3 determining a position in space. Should take the same value as when invoking globeearth. Vector of length 3 determining a position in space. The plot will be rotated so that this position appears to be directly above the centre of the earth. Should take the same value as when invoking globeearth. Length of arrows to be plotted (globearrows only)... Optional additional arguments passed to points (globepoints) or segments (globelines, globearrows). do.plot Logical value indicating whether to actually perform the plotting, or just to return the calculated coordinates. globeearth needs to be invoked first before any of these functions can be used. The values of eye and top in globeearth should be identical to the values used in these functions to get meaningful results. globepoints plots points at the specified locations on the globe. globelines draws line between the specified locations in the order that they are written, but not between the first and last points e.g. if we list three different points A, B, C in loc, then lines will be drawn from A to B, and from B to C, but not C to A. globearrows plots lines at the specified locations, that extend away from the centre of the globe and are of the specified length.

orthogproj 11 The return value is invisible. For globepoints, the return value is a list(x,y) giving the plotted coordinates of the points. For globelines and globearrows, the return value is a 4-column matrix giving the plotted coordinates of the lines or arrows as plotted by segments. globeearth. Use globedrawlat or globedrawlong to draw latitude and longitude curves. ex1 <- matrix(nrow=3, ncol=2) ex1[1,1] <- -80 ex1[1,2] <- 45 ex1[2,1] <- -60 ex1[2,2] <- 45 ex1[3,1] <- -50 ex1[3,2] <- 50 globeearth(eye=place("newyorkcity")) globepoints(loc=ex1, place("newyorkcity"), top=place("northpole")) globelines(loc=ex1, place("newyorkcity"), top=place("northpole")) globearrows(loc=ex1, place("newyorkcity"), top=place("northpole")) orthogproj Orthogonal Projection Project points from the unit sphere onto a plane orthogonal to the viewing direction. orthogproj(eye, top, loc) eye top loc Viewpoint. A vector of length 3 (or a list(lon,lat)) determining a position in space. Top point. A location which will be projected onto the y axis. Vector of length 3 (or a list(lon,lat)) determining a position in space. Vector of length 3, or matrix with 3 columns, or list(lon,lat). The points on the sphere to be projected.

12 place This function is used to obtain orthogonal projections of points on the sphere, for use in plotting 3D views of the sphere. Each point of loc is expressed in an orthonormal coordinate system determined by the arguments eye and top. The coordinate system is such that the third (z) axis passes through the eye of the viewer and the centre of the sphere. A vector (or matrix) giving the transformed coordinates of each point, with the first two coordinates giving the orthogonal projection. globeearth orthogproj(place("newyorkcity"), place("northpole"), c(1,0,0)) place Locations of Some Places on Earth This function gives the locations of selected places on Earth. place(placename) placename Character string giving the name of a place. aarhus and aalborg are cities in Denmark; madrid is the capital of Spain; perth is the capital of Western Australia; curtin is the location of Curtin University, Western Australia; titanic is the location of the wreck of the Titanic; casey and mawson are bases in the Australian Antarctic Territory; newyorkcity, pyongyang, everest, kilimanjaro, northpole and southpole are self explanatory.

runifsphere 13 A list(lon,lat) giving the longitude and latitude in degrees. Source General knowledge. place("aarhus") runifsphere Random Points on a Sphere These functions generate random points on a sphere using different rules. runifsphere(n) runifsphere.wrong(n) n The number of points to be simulated. runifsphere generates uniformly-distributed random points on the sphere. runifsphere.wrong generates random points which are uniformly distributed in (longitude, latitude) coordinates. These are not uniformly distributed on the sphere. A data frame containing two columns of coordinates: the first column for longitude, the second column for latitude. runifsphere(10) runifsphere.wrong(10)

14 spatialpos spatialpos Convert Geographical to Cartesian Coordinates Converts latitudes and longitudes on the sphere into 3D Cartesian coordinates. spatialpos(lon, lat) lon lat A vector, matrix column, or list of longitudes A vector, matrix column, or list of longitudes The longitudes and latitudes can be input as a single entity (i.e. a 2 column matrix, or pair of lists) rather than as separate entities. A matrix with one row per set of Cartesian coordinates ensure3d ensures that the given data is a vector 3D coordinates, and where possible converts the data if they are not in this format. ensurelonlat ensures that the given data are a pair of lists, one list of for longitude, one for latitude, and where possible converts the data if they are not in this format. spatialpos(30, 60) spatialpos(place("nedlands"))

Index Topic datasets earth, 4 place, 12 Topic spatial cross, 2 ensure, 4 flatearth, 5 flatpoints, 6 globe-package, 2 globedrawlat, 7 globeearth, 8 globeplot, 10 orthogproj, 11 runifsphere, 13 spatialpos, 14 orthogproj, 11 place, 12 points, 10 runifsphere, 13 segments, 6, 8 11 spatialpos, 5, 14 cross, 2, 3 dot, 3, 3 earth, 4 ensure, 4 ensure3d (ensure), 4 ensurelonlat (ensure), 4 flatearth, 2, 5, 6, 7, 9 flatpoints, 6, 6 globe (globe-package), 2 globe-package, 2 globearrows, 8, 9 globearrows (globeplot), 10 globedrawlat, 7, 9, 11 globedrawlong, 9, 11 globedrawlong (globedrawlat), 7 globeearth, 2, 6 8, 8, 10 12 globelines, 2, 8, 9 globelines (globeplot), 10 globeplot, 10 globepoints, 2, 8, 9 globepoints (globeplot), 10 15