Générer des graphiques 3D - Cours Université de Sfax



Similar documents
Each function call carries out a single task associated with drawing the graph.

MATHEMATICS Y6 Geometry 6750 Use co-ordinates and extend to 4 quadrants Equipment MathSphere

x y The matrix form, the vector form, and the augmented matrix form, respectively, for the system of equations are

By Clicking on the Worksheet you are in an active Math Region. In order to insert a text region either go to INSERT -TEXT REGION or simply

In this this review we turn our attention to the square root function, the function defined by the equation. f(x) = x. (5.1)

Teacher Page. 1. Reflect a figure with vertices across the x-axis. Find the coordinates of the new image.

Graphing Linear Equations

Solving Quadratic Equations by Graphing. Consider an equation of the form. y ax 2 bx c a 0. In an equation of the form

D.3. Angles and Degree Measure. Review of Trigonometric Functions

Chapter 8. Lines and Planes. By the end of this chapter, you will

GeoGebra. 10 lessons. Gerrit Stols

Web - Travaux Pratiques 1

Answer Key for the Review Packet for Exam #3

Affine Transformations

6. The given function is only drawn for x > 0. Complete the function for x < 0 with the following conditions:

ACT Math Vocabulary. Altitude The height of a triangle that makes a 90-degree angle with the base of the triangle. Altitude

Licence Informatique Année Exceptions

Package tagcloud. R topics documented: July 3, 2015

Section V.2: Magnitudes, Directions, and Components of Vectors

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

When I was 3.1 POLYNOMIAL FUNCTIONS

10.1. Solving Quadratic Equations. Investigation: Rocket Science CONDENSED

Core Maths C2. Revision Notes

Double Integrals in Polar Coordinates

Petrel TIPS&TRICKS from SCM

Students Currently in Algebra 2 Maine East Math Placement Exam Review Problems

Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

Using the Area Model to Teach Multiplying, Factoring and Division of Polynomials

1. a. standard form of a parabola with. 2 b 1 2 horizontal axis of symmetry 2. x 2 y 2 r 2 o. standard form of an ellipse centered

Tutorial 3: Graphics and Exploratory Data Analysis in R Jason Pienaar and Tom Miller

5.1. A Formula for Slope. Investigation: Points and Slope CONDENSED

Polynomial Degree and Finite Differences

Addition and Subtraction of Vectors

North Carolina Community College System Diagnostic and Placement Test Sample Questions

POB-JAVA Documentation

Algebra II. Administered May 2013 RELEASED

DISTANCE, CIRCLES, AND QUADRATIC EQUATIONS

D.2. The Cartesian Plane. The Cartesian Plane The Distance and Midpoint Formulas Equations of Circles. D10 APPENDIX D Precalculus Review

Chapter 6 Quadratic Functions

Liste d'adresses URL

Visualization of 2D Domains

More Equations and Inequalities

CSS : petits compléments

Detection of water leakage using laser images from 3D laser scanning data

Graphics in R. Biostatistics 615/815

15.1. Exact Differential Equations. Exact First-Order Equations. Exact Differential Equations Integrating Factors

Section 11.4: Equations of Lines and Planes

2D Geometrical Transformations. Foley & Van Dam, Chapter 5

The following is an overview of lessons included in the tutorial.

Connecting Transformational Geometry and Transformations of Functions

Excel Using Pivot Tables

Find the Relationship: An Exercise in Graphing Analysis

Physics 53. Kinematics 2. Our nature consists in movement; absolute rest is death. Pascal

ANIMATION OF CONTINUOUS COMPUTER SIMULATIONS C.M. Woodside and Richard Mallet Computer Center, Carleton University ABSTRACT

Understand the Sketcher workbench of CATIA V5.

Introduction to Autodesk Inventor for F1 in Schools

Linear Equations in Two Variables

LINEAR FUNCTIONS OF 2 VARIABLES

Introduction to Autodesk Inventor for F1 in Schools

Advanced Microsoft Excel 2010

Finite Element Modeling

Calcul parallèle avec R

1.6. Piecewise Functions. LEARN ABOUT the Math. Representing the problem using a graphical model

Thursday, February 7, DOM via PHP

Tutorials. If you have any questions, comments, or suggestions about these lessons, don't hesitate to contact us at

Graphing Piecewise Functions

Introduction to the TI-Nspire CX

Enterprise Risk Management & Board members. GUBERNA Alumni Event June 19 th 2014 Prepared by Gaëtan LEFEVRE

Largest Fixed-Aspect, Axis-Aligned Rectangle

ColdGuard Bi-PARTING DOOR INSTALLATION INSTRUCTIONS

RAPPORT FINANCIER ANNUEL PORTANT SUR LES COMPTES 2014

Create Charts in Excel

Lines & Planes. Packages: linalg, plots. Commands: evalm, spacecurve, plot3d, display, solve, implicitplot, dotprod, seq, implicitplot3d.

2.1 Three Dimensional Curves and Surfaces

Metes and Bounds Help

WEB TRADER USER MANUAL

Circles - Past Edexcel Exam Questions

R Graphics Cookbook. Chang O'REILLY. Winston. Tokyo. Beijing Cambridge. Farnham Koln Sebastopol

Plane Stress Transformations

Solving Simultaneous Equations and Matrices

Millier Dickinson Blais

Gerrit Stols

Drawing a histogram using Excel

KaleidaGraph Quick Start Guide

Introduction to ANSYS ICEM CFD

Numéro de projet CISPR Amd 2 Ed IEC/TC or SC: CISPR/A CEI/CE ou SC: Date of circulation Date de diffusion

Excel Using Pivot Tables

Régression logistique : introduction

1.5 SOLUTION SETS OF LINEAR SYSTEMS

SolidWorks Implementation Guides. Sketching Concepts

Roots of equation fx are the values of x which satisfy the above expression. Also referred to as the zeros of an equation

Pro/ENGINEER Wildfire 4.0 Basic Design

Colegio del mundo IB. Programa Diploma REPASO The mass m kg of a radio-active substance at time t hours is given by. m = 4e 0.2t.

Processing the Image or Can you Believe what you see? Light and Color for Nonscientists PHYS 1230

COMPONENTS OF VECTORS

Sun Management Center Change Manager Release Notes

Shake, Rattle and Roll

7.7 Solving Rational Equations

Transcription:

Générer des graphiques 3D - Cours Université de Sfa Marc Girondot Januar 24, 2013 Générer des données 3D > librar(fields) > essai <- function(, ) return (^2+^2+runif(1, min=1, ma=3)) > essai(1, 2) [1] 6.968858 > <- seq(from=-10, to=10, b=0.5) > <- seq(from=-10, to=10, b=0.5) > z <- outer(,, essai) > str(z) num [1:41, 1:41] 202 192 183 174 166... 1

Utilisation de image.plot La fonction image.plot est disponible dans le package fields. Draws image plot with a legend strip for the color scale based on either a regular grid or a grid of quadrilaterals. Description This function combines the R image function with some automatic placement of a legend. This is done b splitting the plotting region into two parts. Putting the image in one and the legend in the other. It also allows for plotting quadrilateral cells in the image format that often arise from regular grids transformed with a map projection. Usage image.plot(..., Arguments add = FALSE, nlevel = 64, horizontal = FALSE, legend.shrink = 0.9, legend.width = 1.2, legend.mar = ifelse(horizontal, 3.1, 5.1), legend.lab = NULL, graphics.reset = FALSE, bigplot = NULL, smallplot = NULL, legend.onl = FALSE, col = tim.colors(nlevel), lab.breaks = NULL, ais.args = NULL, legend.args = NULL, midpoint=false, border=na, lwd=1.0)... The usual arguments to the image function as,,or z or as a list with,,z as components. One can also include a breaks argument for an unequal color scale with color scale boundaries at the breaks (see eample below). If a quadrilatera l grid, arguments must be eplicitl, and z with, and being matrices of dimension equal or one more than z giving the grid locations. The basic concept is that the coordinates of and still define a grid but the image cells are general quadrilaterals rather than being restricted to rectangles. See details below as to how one handles whether the quads are specified b their vertices or b their midpoints. add If true add image and a legend strip to the eisting plot. nlevel Number of color levels used in legend strip legend.shrink 2

Amount to shrink the size of legend relative to the full height or width of the plot. legend.width Width in characters of the legend strip. Default is 1.2, a little bigger that the width of a character. legend.mar Width in characters of legend margin that has the ais. Default is 5.1 for a vertical legend and 3.1 for a horizontal legend. legend.lab Label for the ais of the color legend. Default is no label as this is usual evident from the plot title. graphics.reset If FALSE (default) the plotting region ( plt in par) will not be reset and one can add more information onto the image plot. (e.g. using functions such as points or lines.) If TRUE will reset plot parameters to the values before entering the function. horizontal If false (default) legend will be a vertical strip on the right side. If true the legend strip will be along the bottom. bigplot Plot coordinates for image plot. If not passed these will be determined within the function. smallplot Plot coordinates for legend strip. If not passed these will be determined within the function. Be sure to leave room for the ais labels. For eample, if the legend is on the right side smallplot= c(.85,.9,0,1) will leave (.1 in plot coordinates) for the ais labels to the right of the color strip. This argument is useful for drawing a plot with the legend that is the same size as the plots without legends. legend.onl If TRUE just add the legend to a the plot in the plot region defined b the coordinates in smallplot. In the absence of other information the range for the legend is determined from the zlim argument. col Color table to use for image ( see help file on image for details). Default is a pleasing range of 64 divisions suggested b Tim Hoar and is similar to the MATLAB (TM) jet color scheme. 3

lab.breaks If breaks are supplied these are tet string labels to put at each break value. This is intended to label ais on a transformed scale such as logs. ais.args Additional arguments for the ais function used to create the legend ais. (See eample below adding a log scaling.) legend.args Arguments for a complete specification of the legend label. This is in the form of list and is just passed to the mtet function. Usuall this will not be needed. (See eample below.) midpoint This option for the case of unequall spaced grids with and being matrices of grid point locations. If FALSE (default) the quadralaterals will be etended to surround the z locations as midpoints. If TRUE z values will be averaged to ield a midpoint value and the original grid points be used to define the quadralaterals. (See help on pol.image for details). In most cases midpoint should be FALSE to preserve eact values for z and let the grid polgons be modified. border This onl works if and are matrices - if NA the quadralaterals will have a border color that is the same as the interior color. Otherwise this specifies the color to use. lwd Line width of borders around piels. This might need to be set less than 1.0 to avoid visible rounding of the piel corners. 4

> image.plot(,, z, col=tim.colors(16)) 200 150 100 50 > image.plot(,, z, col=tim.colors(128)) 200 150 100 50 5

> image.plot(,, z, col=heat.colors(16)) 200 150 100 50 > image.plot(,, z, col=heat.colors(128)) 200 150 100 50 6

> image.plot(,, z, col=rainbow(16)) 200 150 100 50 > image.plot(,, z, col=rainbow(128)) 200 150 100 50 7

Utilisation de persp persp est disponible dans le package graphics. Perspective Plots Description This function draws perspective plots of a surface over the - plane. persp is a generic function. Usage persp(,...) ## Default S3 method: persp( = seq(0, 1, length.out = nrow(z)), = seq(0, 1, length.out = ncol(z)), z, lim = range(), lim = range(), zlim = range(z, na.rm = TRUE), lab = NULL, lab = NULL, zlab = NULL, main = NULL, sub = NULL, theta = 0, phi = 15, r = sqrt(3), d = 1, scale = TRUE, epand = 1, col = "white", border = NULL, ltheta = -135, lphi = 0, shade = NA, bo = TRUE, aes = TRUE, nticks = 5, ticktpe = "simple",...) Arguments, locations of grid lines at which the values in z are measured. These must be in ascending order. B default, equall spaced values from 0 to 1 are used. If is a list, its components $ and $ are used for and, respectivel. z a matri containing the values to be plotted (NAs are allowed). Note that can be used instead of z for convenience. lim, lim, zlim -, - and z-limits. These should be chosen to cover the range of values of the surface: see 'Details'. lab, lab, zlab titles for the aes. N.B. These must be character strings; epressions are not accepted. Numbers will be coerced to character strings. 8

main, sub main and sub title, as for title. theta, phi angles defining the viewing direction. theta gives the azimuthal direction and phi the colatitude. r the distance of the eepoint from the centre of the plotting bo. d a value which can be used to var the strength of the perspective transformation. Values of d greater than 1 will lessen the perspective effect and values less and 1 will eaggerate it. scale before viewing the, and z coordinates of the points defining the surface are transformed to the interval [0,1]. If scale is TRUE the, and z coordinates are transformed separatel. If scale is FALSE the coordinates are scaled so that aspect ratios are retained. This is useful for rendering things like DEM information. epand a epansion factor applied to the z coordinates. Often used with 0 < epand < 1 to shrink the plotting bo in the z direction. col the color(s) of the surface facets. Transparent colours are ignored. This is reccled to the (n-1)(n-1) facets. border the color of the line drawn around the surface facets. The default, NULL, corresponds to par("fg"). A value of NA will disable the drawing of borders: this is sometimes useful when the surface is shaded. ltheta, lphi if finite values are specified for ltheta and lphi, the surface is shaded as though it was being illuminated from the direction specified b azimuth ltheta and colatitude lphi. shade the shade at a surface facet is computed as ((1+d)/2)^shade, where d is the dot product of a unit vector normal to the facet and a unit vector in the direction of a light source. Values of shade close to one ield shading similar to a point light source model and values close to zero produce no shading. Values in the range 0.5 to 0.75 provide an approimation to dalight illumination. 9

bo should the bounding bo for the surface be displaed. The default is TRUE. aes should ticks and labels be added to the bo. The default is TRUE. If bo is FALSE then no ticks or labels are drawn. ticktpe character: "simple" draws just an arrow parallel to the ais to indicate direction of increase; "detailed" draws normal ticks as per 2D plots. nticks the (approimate) number of tick marks to draw on the aes. Has no effect if ticktpe is "simple".... additional graphical parameters (see par). Couleur des facettes fonction du niveau La commande z[-1, -1] permet de prendre tous les points sauf le point de coordonnée 1, 1. Dans z, il a la couleur au point d intersection et. Si on travaille sur des surfaces, il a donc une surface de moins que d intersection à la fois sur et sur. Dans zfacet, il a donc la valeur de z au centre de l élément. La fonction cut() permet de discrétiser un objet continu. 10

z z Effet du paramètre theta > persp(,, z, theta=0) > persp(,, z, theta=30) 11

z z > persp(,, z, theta=45) > persp(,, z, theta=90) 12

z Effet du paramètre phi > persp(,, z, phi=0) z > persp(,, z, phi=15) 13

> persp(,, z, phi=45) z 14

z z Graphique d une couleur homogène avec ou sans ombrage > persp(,, z, phi=15, col = "lightblue") > persp(,, z, phi=15, col = "lightblue", shade=0.5) 15

z > nrz <- nrow(z) > ncz <- ncol(z) > nbcol <- 128 > zfacet <- (z[-1, -1] + z[-1, -ncz] + z[-nrz, -1] + z[-nrz, -ncz])/4 > facetcol <- cut(zfacet, nbcol) > color <- heat.colors(nbcol) > persp(,, z, col=color[facetcol], phi=15, theta=0) > persp(,, z, col=color[facetcol], phi=90, theta=0, d=100) 16 z

z Couleur des facettes selon un arc en ciel > color <- rainbow(nbcol) > persp(,, z, col=color[facetcol], phi=15, theta=0) > persp(,, z, col=color[facetcol], phi=90, theta=0, d=100) z 17

z Couleur des facettes selon un dégradé du bleu vers le vert > jet.colors <- colorramppalette( c("blue", "green") ) > color <- jet.colors(nbcol) > persp(,, z, col=color[facetcol], phi=15, theta=0) > persp(,, z, col=color[facetcol], phi=90, theta=0, d=100) 18 z

Représentation grâce à levelplot levelplot du package lattice permet aussi de représenter une surface avec des niveau de couleur proportionnel à une valeur. > librar("lattice") > grid <- epand.grid(=, =) > levelplot(z~*, grid, cuts = 64, lab="", lab="", main="", colorke = TRUE, region = TRU 200 5 150 0 100 5 50 0 5 0 5 19