Attribution Non-Commercial (BY-NC)

2 views

Attribution Non-Commercial (BY-NC)

- Slope Calculation From Contour Lines in a Topographic Map
- Tcs Aspire Java1
- MGSEM1
- Sci Lab 2
- b Cg74 Consolidated
- hackingwpaE
- Lens Pro III Aft
- Pw0250 Objectives v.02
- Transforming Auto Encoders.
- Proxy Radius Configuration
- lesson plan for linda dempsey
- ele401week6
- 3gpp
- User Guide 12
- Manual Cisco 2960
- Maths Previous
- Surfer 9
- BE OU FirstYear EnggGraph May June 12
- Development of Surface Final
- rfc3127.txt

You are on page 1of 43

Bijan Mobasseri

Department Of Electrical and Computer Engineering Villanova University

1 / 43

Objectives

Create surface plots in a variety of shapes. Shading surfaces for better visibility. View point control. Draw 3D geometric fgures such as spehres, cylinders and cones.

2 / 43

A 3-D plot can be interpreted as heights above the ground plane. These heights are evaluated at some predened grid points

3 / 43

The groundplane must rst be represented by a grid This grid in reality consists of two matrices: x and y

4 / 43

Lets say we want to sample the ground plane by a grid of points; x=-8:0.5:8; y=x; [X,Y]=meshgrid(x,y) X and Y are now matrices, as shown on the next slide.

5 / 43

6 / 43

The mesh command produces a plot of the desired surface expressed in z z= sin x2 + y2 x2 + y2

7 / 43

Another look

8 / 43

There are a number of built-in functions in MATLAB that we can just use In the 2D case, we have humps

Example: plot(humps)

mesh(peaks)

9 / 43

Use of mesh(Z) plots Z vs. index positions To plot Z vs. actual units of X and Y:

[X,Y]=meshgrid(-3:0.2:3) Z=peaks(X,Y); mesh(X,Y,Z)

10 / 43

In mesh(X,Y,Z), X and Y must come out of meshgrid. This is wrong x=-3:0.1:3 y=x; Z=peaks(x,y) mesh(Z) This is right x=-3:0.1:3 y=x; [X,Y]=meshgrid(x,y) Z=peaks(X,Y) mesh(Z)

11 / 43

Contour Plot

Contours are slices of constant height that are then projected onto the ground plane In its simplest form meshc(Z) does the job

12 / 43

Curtain Plot

You can put your plot on a pedestal by using meshz(Z)

13 / 43

Waterfall Plots

An interesting effect can be generated by just plotting the rows of the Z matrix using

waterfall(X,Y,Z)

14 / 43

mesh generates discrete plots. To generate surfaces with solid shading, surf and its variations are used These variations are

surf surfl surfc

15 / 43

Using surf

Usage:

surf(X,Y,Z,C)

(X,Y) is generated via meshgrid command and Z is the height of the function. Z-to-color mapping is done according to the entries into "colormap" via C (more on that later) If surf(Z) is used, color is proportional to height Z.

16 / 43

17 / 43

Shading control

Shading can be applied to surface objects to enhance viewing. There are three types of shading, 1) at, 2) faceted and 3) interpolated In at shading, surface patches are shaded in constant colors. In interpolated shading, surface patches have a color gradient proportional to the z-value. Faceted shading is the same as at shading except for the black mesh lines.

18 / 43

Flat shading

19 / 43

Faceted shading

20 / 43

Interpolated shading

21 / 43

2D Contour Example

Here you slice the surface at 10 different heights and project the contours on the ground plane. Each contour represent a xed height.

22 / 43

3D contours

contour3(x,y,z,20)

23 / 43

Filled contours

contourf(x,y,z,10)

24 / 43

surfc(x,y,z,10)

25 / 43

Controlling Viewpoint

Viewpoint is controlled by two angles: azimuth and elevation Azimuth is rotation around the Z-axis Elevation is rising above the ground plane

26 / 43

Default Viewpoints

In MATLAB, default viewpoints are az=-37.5 and el=30 degrees Zero degrees azimuth is like looking up the rst column of the Z matrix. Zero degrees of elevation is like looking "edge on" the Z matrix

27 / 43

Increasingly negative azimuth is like holding the object in front of you while rotating it counterclockwise. Look at the next slide for a demonstration

28 / 43

32 / 43

Positive elevation angle means rising above the object. Elevation of +90 degrees means being directly overhead and looking down Check this out yourself

33 / 43

View command

Controlling view point is done through the view command Display your 3D plot then use view([-35,60])

34 / 43

If you have a 3D-display but dont know what your viewpoint is, use the following: [az,el]=view MATLAB returns azimuth and elevation view points of the current plot

35 / 43

Display your 3D plot then type rotate3d in the command window Now bring the gure window to the fore, click on it, hold down the mouse button and then move it around

36 / 43

You can shine light on a surface from a desired direction Shading is based on a combination of diffuse, specular and ambient lighting models Usage:

surfl(X,Y,Z,S) S=lighting direction=[az,el]

37 / 43

To save space, we can divide the paper into a grid and place a separate plot inside each grid

38 / 43

Subplot command

subplot(mnp) divides the page into m(rows)n(columns) tiles then selects the pth tile for plotting

39 / 43

sphere(n) will generate a plot of unit sphere using (n + 1)2 points. Another usage is

[x,y,z]=sphere(25) surf(x,y,z)

40 / 43

Cylinder

cylinder(radius,pnts) generates a cylinder of radius using N points along each axis

41 / 43

Generalized cylinder

A generalized cylinder is a solid whose axis is a 3-D space curve and a variable radius cross section.

42 / 43

Cylinder(radius) where radius is the cross sectional radius described by a vector that changes in length.

43 / 43

- Slope Calculation From Contour Lines in a Topographic MapUploaded byzartol
- Tcs Aspire Java1Uploaded byAnagha Walimbe
- MGSEM1Uploaded byJASON_INGHAM
- Sci Lab 2Uploaded byhoney_janu
- b Cg74 ConsolidatedUploaded byAsangab
- hackingwpaEUploaded byziver2k
- Lens Pro III AftUploaded byMohammad A. Abu Warda
- Pw0250 Objectives v.02Uploaded bySuhas Prahalada
- Transforming Auto Encoders.Uploaded bymyspams
- Proxy Radius ConfigurationUploaded bywairpru2007
- lesson plan for linda dempseyUploaded byapi-214216371
- ele401week6Uploaded byHk Ma
- 3gppUploaded bydezzgs
- User Guide 12Uploaded byLater
- Manual Cisco 2960Uploaded byCesar Augusto Jimenez Andrade
- Maths PreviousUploaded bySunil Abdul Salam
- Surfer 9Uploaded bynejork
- BE OU FirstYear EnggGraph May June 12Uploaded bySri D
- Development of Surface FinalUploaded byans
- rfc3127.txtUploaded byneva0203
- Quickstart Cinema 4d r17 EnUploaded byDaz Arunabh
- en_SWITCH_v7_Ch07.pptxUploaded bylinda guzman
- Rima Putri Property's RPP PKN SD Kelas II_IUploaded byJoko
- SuHotSpot - RADIUS Users AttributesUploaded bynacerx99
- NALANDAUploaded bywarekar
- Investigacao COREUploaded byIrzelindo Joaquim
- ExercisesUploaded byMacky Tan
- 1408615750-1.pdfUploaded bypappu
- S262900_TwoWiresUploaded byAndrés SanPer
- 944064267maths Class Viii Periodic Test 02 Exam Sample Paper 02Uploaded byRavi Kumar

- Debenhams Analyst ReportUploaded byFisher Black
- BS107A.pdfUploaded byver
- Gilat vs UCPB SummaryUploaded byLoi Caparida
- Provision of a Air Well for the Purpose of Natural Light, And Ventilation Court YardUploaded bySadeep Madhushan
- Mathematical Optimization and Economic TheoryUploaded byJing He
- Sworn Statements FormatUploaded byJr Morallos
- RIA Chad HassingerUploaded byHugo Cruz
- Mix Design M-40 GradeUploaded byPruthvi Teja
- How Did the Puna Plateau FormUploaded byMattt
- ACH13 Instruction Sheet R01[1]Uploaded byshotowj
- People v JavaUploaded bySoc
- CBE205 SyllabusUploaded byclaraodel
- Simulation of Formation Damage After Long-Term Water FloodingUploaded byAsma Sed
- Paytm ProjectUploaded byRashmi Mishra
- CVCUploaded byHanif Malpekar
- Foamed Cellular Light Weight ConcreteUploaded byIrshad
- OMD6068 Case Analysis--Call Drop ISSUE1.1.pptUploaded byWaqas Khan
- CON8279_Kent-2014.09.29_Dijcks_Kent_OOW_Oracle Big Data Appliance OOW V3 (1)Uploaded byrprytz
- Company Profile of Bank MandiriUploaded byTee's O-Rama
- Msr Hedging CostsUploaded byMayank
- 812L_822L REDBOOKUploaded byilya
- Komponen Panel Listrik – HW ElektrindoUploaded bydhanysiregar
- Vcr Seminar PptUploaded byJyothi Reddy
- F-24a_echinacea_phenolics HPTLC Identification of Echinacea.pdfUploaded byNarongchai Pongpan
- Professional ProfileUploaded byAlex Glinsky - Dedicated Law Enforcement Officer
- Microprocessors and Microcontrollers/Interfacing With 8086Uploaded byvipuljain1989
- Modelling of Negative Skin Friction on Bored Piles in ClayUploaded byLordM00n
- Meaning of BancassuranceUploaded byMonika Tajenderpal Saini
- Tirupati Swd Dpr 26.12.2016Uploaded byrajsedasari
- 2012.4wtr.rally- fmsci rALLY ROLL CAGE SPECIFICATIONUploaded byBuzurjmeher

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.