曲面曲线 curves and surfaces for CAGD

曲面曲线 curves and surfaces for CAGD
曲面曲线 curves and surfaces for CAGD

Curves and Surfaces for Computer Graphics

To the memory of Pierre Etienne B′e zier(1910–1999).

Only for you,children of doctrine and learning,have we

written this work.Examine this book,ponder the meaning

we have dispersed in various places and gathered again;

what we have concealed in one place we have disclosed

in another,that it may be understood by your wisdom.

–Heinrich Agrippa von Nettesheim,De Occulta Philosophia,(1531)

David Salomon

Curves and Surfaces for Computer Graphics With207Figures,12in Full Color

David Salomon(Emeritus)

Department of Computer Science

California State University,Northridge

Northridge,CA91330-8281

U.S.A.

dsalomon@https://www.360docs.net/doc/4f5268702.html,

ISBN-10:0-387-24196-5e-ISBN:0-387-28452-4Printed on acid-free paper. ISBN-13:978-0-387-24196-8

?2006Springer Science+Business Media,Inc.

All rights reserved.This work may not be translated or copied in whole or in part without the written permission of the publisher(Springer Science+Business Media,Inc.,233Spring St.,New York,NY10013,USA),except for brief excerpts in connection with reviews or scholarly https://www.360docs.net/doc/4f5268702.html,e in connection with any form of information storage and retrieval, electronic adaptation,computer software,or by similar or dissimilar methodology now known or hereafter developed is forbidden.

The use in this publication of trade names,trademarks,service marks,and similar terms,even if they are not identified as such,is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printed in the United States of America.(HAM)

987654321SPIN11360285

https://www.360docs.net/doc/4f5268702.html,

Preface

Images are all around us.We see them in color and in high resolution.In fact,the natural images we see with our eyes seem perfectly smooth,with no jagged edges and no https://www.360docs.net/doc/4f5268702.html,puter graphics,on the other hand,deals with images that consist of small dots,pixels.When we?rst hear of this feature of computer graphics,we tend to dismiss the entire?eld as trivial.It seems intuitively obvious that an image that consists of dots would always look arti?cial,rough,and inferior to what we see with our eyes.Yet state-of-the-art computer-generated images are often di?cult or impossible to distinguish from their real counterparts,even though they are discrete,made of pixels, and not continuous.

A similar dichotomy exists in painting.Many painters try to mimic nature and paint smooth and continuous pictures.Others choose to be pointillists.They paint by placing many small dots on their canvas.The most important pointillist was the19th century French impressionist Georges Seurat.

Georges Seurat(1859–1891)was a leader in the late19th century neo-impressionism movement,a school of painting that uses tiny brushstrokes of contrasting colors to achieve a delicate play of light and create subtle changes in form(Figure C.1).Seurat used this technique,which became known as pointillism or divisionism,to create huge paintings that are made entirely of small dots of pure color.The dots are too small to be distinguished when looking at the work in its entirety,but they make his paintings shimmer with brilliance.His most well-known works are Une Baignade(1883–84)and Un dimanche apr`e s-midi`a l’Ile de la Grande Jatte(1884–86).The art critic Ars`e ne Alexandre had this to say about the latter painting:“Everything was so new in this immense painting—the conception was bold and the technique one that nobody had ever seen or heard before.This was the famous pointillism.”

Even though it generates discrete images made of dots,the?eld of computer graph-ics has been extremely successful.It has started from nothing in the1960s and has since attracted many workers and researchers.They developed general techniques and specialized algorithms to generate and manipulate images and thereby turned computer graphics into the useful,practical discipline it is today.

vi Preface

The chief aim of computer graphics is to display and print realistic-looking images. This task is achieved by computing the outer surface of the object or objects to be displayed,and rendering it by simulating the way it is seen in real life.Most real objects are visible because they re?ect light,so the main task of rendering is to simulate light re?ection.(Relatively few objects are visible because of light that they generate.A completely transparent object is visible by the light it refracts.Most objects,however, do not generate light and are not transparent.They are seen because they re?ect some of the light that falls on them.)

Rendering is therefore an important part of computer graphics,but this book is concerned with the computations of surfaces.In order to render a real object,such as a teapot or a car,its surface has?rst to be calculated and stored in the computer as a mathematical expression.This expression is a model of the real object,which is why the process of generating the model is known as geometric modeling.The rendering algorithm then scans the surface point by point,computes the normal vector to the surface at every point,and uses the normal to compute the amount and color of light re?ected from the point.

The book also deals with curves,because an understanding of curves is a key to understanding surfaces.Most mathematical methods for curves can be extended to surfaces,which is why this book covers various approaches to curve design and shows that many curve methods can be generalized to surfaces.

The most important term in the?eld of curve and surface design is interpolation. It comes from the Latin inter(between)and polare(to polish)and it means to compute new values that lie between(or that are an average of)certain given values.A typical algorithm for curves starts with a set of points and employs interpolation to compute a smooth curve that passes through the points.Such points are termed data points and they de?ne an interpolating curve.Some methods start with both points and vectors and compute a curve that passes through the points and at certain points also moves in the directions of the given vectors.

Another important term in this?eld is approximation.Certain curve and surface methods start with points and perhaps also vectors and compute a curve or a surface that passes close to the points but not necessarily through them.Such points are known as control points and the curve or the surface de?ned by them is referred to as an approximating curve or surface.Most chapters of this book describe interpolation or approximation methods.

Chapter1presents the basic theory of curves and surfaces.It discusses the all-important parametric representation and covers basic concepts such as curvature,tan-gent vectors,normal vectors,curve and surface continuity,and Cartesian products.

Chapter2introduces the simplest curves and surfaces.Straight lines,?at planes, triangles,and bilinear and lofted surfaces are presented and illustrated with examples.

Chapter3discusses polynomial interpolation.Given a set of points,the problem is to compute a polynomial that passes through them.This problem is then extended to a surface patch that passes through a given two-dimensional set of points.The chapter starts with the important parametric cubic(PC)curves.It continues with the general method of Lagrange interpolation and its relative,the Newton interpolation method. Simple polynomial surfaces are presented,followed by Coons surfaces,a family of simple surface patches based on polynomials.

Preface vii The mathematically-elegant Hermite interpolation technique is the topic of Chap-ter4.The chapter discusses cubic and higher-order Hermite curve segments,special and degenerate hermite segments,Hermite interpolation curves,the Ferguson surface patch,the Coons surface patch,the bicubic surface patch,and Gordon surfaces.A few less-important topics are also touched upon.

The important concept of splines is covered in Chapter5.Spline methods for curves and surfaces are more practical than polynomial methods and several spline methods are based on Hermite interpolation.The main topics in this chapter are cubic splines(sev-eral varieties are discussed),cardinal splines,Kochanek–Bartels splines,spline surface patches,and cardinal spline patches.

Chapter6is devoted to B′e zier methods for curves and surfaces.The Bernstein form of the B′e zier curve is introduced,followed by techniques for fast computation of the curve and by a list of the properties of the curve.This leads to a discussion of how to smoothly connect Bezier segments.The de Casteljau construction of the B′e zier curve is described next.It is followed by the technique of blossoming and by methods for subdividing the curve,for degree elevation and for controlling its tension.Sometimes one wants to interpolate a set of points by a B′e zier curve and this problem is also discussed. Rational B′e zier curves have important advantages and are assigned a separate section.

The chapter continues with material on B′e zier surfaces.The topics discussed are rectangular B′e zier surfaces and their smooth joining,triangular B′e zier surfaces and their smooth joining,and the Gregory surface patch and its tangent vectors.

The last of the“interpolation/approximation”chapters is Chapter7,on the all-important B-spline technique.B-spline curve topics are the quadratic uniform B-spline curve,the cubic uniform B-spline curve,multiple control points,cubic B-splines with tension,higher-degree uniform B-splines,interpolating B-splines,open uniform B-spline, nonuniform B-splines,matrix form of the nonuniform B-spline curve,subdividing the B-spline curve,and NURBS.The B-spline surface topics are uniform B-spline surfaces, an interpolating bicubic patch,and a quadratic-cubic B-spline patch.

Subdivision methods for curves and surfaces are discussed in Chapter8.These methods are also based on interpolation,but are di?erent from the traditional interpo-lation methods discussed in the preceding chapters.The following important techniques are described in this chapter:The de Casteljau re?nement process,Chaikin’s algorithm, the quadratic uniform B-spline curve,the cubic uniform B-spline curve,bi-quadratic B-spline patches,bicubic B-spline patches,Doo–Sabin subdivision methods,Catmull–Clark surfaces,and Loop subdivision surfaces.

Chapter9presents the various types of sweep surfaces.This is a completely dif-ferent approach to surface design and representation.A sweep surface is generated by constructing a curve and moving it along another curve,while optionally also rotating and scaling it,to create a surface patch.A special case of sweep surfaces is surfaces of revolution.They are created when a curve is rotated about an axis.

Appendix A is a short discussion of conic sections,a family of simple curves that have special applications.

Appendix B discusses simple methods for the approximate representation of circles by polynomials.

Appendix C is a small collection of color images,most of which appear elsewhere in the book in grayscale.

viii Preface

Finally,Appendix D discusses several useful and interesting commands and tech-niques employed in the various Mathematica code listings sprinkled throughout the book.

History of Curves and Surfaces

Section2.4discusses lofted surfaces but does not explain the reason for this unusual name.Historically,shipbuilders were among the?rst to mechanize their operation by developing mathematical models of surfaces.Ships tend to be big and the only dry place in a shipyard large enough to store full-size drawings of ship parts was in the sail lofts above the shipyard’s dry dock.Certain parts of a ship’s surface are?at in one direction and curved in the other direction,so such surfaces became known as lofted.

In the1960s,both car and aircraft manufacturers became interested in applying computers to automate the design of their vehicles.Traditionally,artists and designers had to make clay models of each part of the surface of a car or airplane and these models were later used by the production people to produce stamp molds.With the help of the computer it became possible to design a section of surface on the computer in an interactive process,then have the computer drive a milling machine to actually make the part.

The box on page175mentions the work of Pierre B′e zier at Renault and Paul de Casteljau at Citro¨e n,the contributions of Steven Coons to Ford Motors and William Gordon and Richard F.Riesenfeld to General Motors,and the e?orts of James Ferguson in constructing airplane surfaces.

As a result of these developments in the1960s and1970s,the area of computer graphics that deals with curves and surfaces has become known,in1974,as computer assisted geometric design(CAGD).Several sophisticated CAGD software systems have been developed in the1980s for general use in manufacturing and in other?elds such as chemistry(to model molecules),geoscience(for specialized maps),and architecture(for three-dimensional models of buildings).

Hardware developments in the1980s made it possible to use CAGD techniques in the1990s to produce computer-generated special e?ects for movies(an example is Jurassic Park),followed by full-length movies,such as Toy story,Finding Nemo,and Shrek,that were entirely generated by computer.

A detailed survey of the history of this?eld can be found in[Farin04].Several ?rst-person historical accounts by pioneers in this?eld are collected in[Rogers01].

Resources for Curves and Surfaces

As is natural to expect,the World Wide Web has many resources for CAGD.In addition to the many texts available in this?eld,the journals CAD and CAGD carry state-of-the-art papers and articles.See[CAD04]and[CAGD04].Following is a list of some of the most important resources for computer graphics,not just CAGD,current as of mid-2005.

https://www.360docs.net/doc/4f5268702.html,/is the o?cial home page of SIGGRAPH,the special interest group for graphics,one of many SIGs that are part of the ACM.

The Web page https://www.360docs.net/doc/4f5268702.html,/conferences/fundamentals has useful course notes from SIGGRAPH conferences.

Preface ix The Web page https://www.360docs.net/doc/4f5268702.html,/faqs/graphics/faq/by John Grieggs has answers to frequently-asked questions on graphics,as well as pointers to other resources. It hasn’t been updated since1995.

See https://www.360docs.net/doc/4f5268702.html,/~parent/book/outline.html for the lat-est version of Richard Parent’s book on computer animation.

https://www.360docs.net/doc/4f5268702.html,/psl/cg.html is a jumping point to many sites that deal with computer graphics.

A similar site is https://www.360docs.net/doc/4f5268702.html,/~ncs/graphics.html that also has many links to CG sites.

http://ls7-www.cs.uni-dortmund.de/cgotn/is a very extensive site of computer-graphics-related pointers.

IEEE Computer Graphics and Applications is a technical journal carrying research papers and news.See https://www.360docs.net/doc/4f5268702.html,/cga.

Animation Magazine is a monthly publication covering the entire animation?eld, computer and otherwise.Located at https://www.360docs.net/doc/4f5268702.html,/animag/.

Computer Graphics World is a monthly publication concentrating on news,see https://www.360docs.net/doc/4f5268702.html,/home.cfm.

An Internet search for CAD or CAGD returns many sites.

Software Resources

Those who want to experiment with curves and surfaces can either write their own soft-ware(most likely in OpenGL)or learn to use one of several powerful software packages available either commercially or as freeware.Here are the ones found by the author in mid2005.

Mathematica,from[Wolfram Research05],is the granddaddy of all mathematical software.It has facilities for numerical computations,symbolic manipulations,and graphics.It also has all the features of a very high-level programming language.

Matlab(matrix lab),from[Mathworks05]is a similar powerful package that many ?nd easier to use.

Blender is powerful software that computes and displays many types of curves and surfaces.It has powerful tools for animation and game design and is available for several platforms from[Blender05].

DesignMentor is a free software package that computes and displays curves,surfaces, and Voronoi regions and triangulations.It is available from[DesignMentor05].

Wings3D,from[Wings3D05],is free software that constructs subdivision surfaces.

GIMP is a free image manipulation program for tasks such as photo retouching, image composition,and image authoring.It is available from[GIMP05]for many operating systems,in many languages,but it does not compute curves and surfaces.

x Preface

A Word on Notation

It is common practice to represent nonscalar quantities such as points,vectors,and matrices with boldface.Below are examples of the notation used here:

x,y,z,t,u,v Italics are used for scalar quantities such as coordinates

and parameters.

P,Q i,v,M Boldface is used for points,vectors,and matrices.

CP An alternative notation for vectors,used when the two

endpoints of the vector are known.

P(t),P(u,v)Boldface with arguments is used for nonscalar functions

such as curves and surfaces.

a11a12 a21a22

Parentheses(sometimes square brackets)are used for ma-

trices.

a11a12

a21a22

Vertical bars are used for determinants.

|v|The absolute value(length)of vector v.

A T The transpose of matrix A.

x?,P?The transformed values of scalars and points.

f u(u),P t(t),P tt(t)The(?rst or second)derivatives of scalar and vector func-

tions.For third and higher derivatives,a prime is usually

used.

d f(u) du ,

d P(t)

dt

Alternative notation for derivatives.

d f2(u) du2,

d P2(t)

dt2

Alternative notation for higher-order derivatives.

?f(u,v)

,?P(u,v)

Partial derivatives.

f(x)|x

or f(x0)Value of function f(x)at point x0. n

i=1

x i The sum x1+x2+···+x n.

n

i=1

x i The product x1x2...x n.

Preface xi Exercise1:What is the meaning of(P1,P2,P3,P4)?

Readership of the Book

The book aims at mathematically mature readers(i.e.,those who can deal comfortably with mathematical abstractions),who are familiar with computers and computer graph-ics,and are looking for a mathematically-easy presentation of geometric modeling.The material presented here requires no previous knowledge of curves,splines,or surfaces. The key ideas are introduced slowly,are examined,when possible,from several points of view,and are illustrated by?gures,examples,and(solved)exercises.The discussion must involve some mathematics,but it is nonrigorous and therefore easy to grasp.The mathematical background required includes polynomials,matrices,vector operations, and elementary calculus.The following features enhance the usefulness of the book: The powerful Mathematica software system is used throughout the book to imple-ment the various concepts discussed.When a?gure is computed in Mathematica,the code is listed with the?gure.These codes are meant to be readable rather than ef-?cient and fast,and are therefore easy to read and to modify even by inexperienced Mathematica users.

The book has many examples.Experience shows that examples are important for a thorough understanding of the kind of material discussed in this book.The conscien-tious reader should follow each example carefully and try to work out variations of the examples.Many examples also include Mathematica code.

Many exercises are sprinkled throughout the text.These are also important and should be worked out.The answers are also provided,but should be consulted only to verify the reader’s own answer,or as a last resort.

The book aims to be practical,not theoretical.After reading and understanding a topic,the reader should be able to design and implement the concepts discussed there. The few mathematical proofs found in the book are simple,and there is no attempt to present an overall theory encompassing all curves and surfaces.The following advice by Proust is adhered to:

A book in which there are theories is like an article from which the price mark has

not been removed.

—Marcel Proust,Time Regained(1921).

Currently,the book’s Web site is part of the author’s Web site,which is located at https://www.360docs.net/doc/4f5268702.html,/~dsalomon/.Domain name https://www.360docs.net/doc/4f5268702.html, has been reserved and will always point to any future location of the Web site.The author’s email address is dsalomon@https://www.360docs.net/doc/4f5268702.html,,but any email sent to email address anyname @https://www.360docs.net/doc/4f5268702.html, will reach the author.

I would like to thank Garry Helzer for his Mathematica implementation of the triangular B′e zier surfaces.Figures6.31and C.2were computed with this code.The Mathematica notebook for this code is available in the book’s Web site.

xii Preface

This book is dedicated to the memory of Pierre B′e zier,but the?eld of computer aided geometric design(CAGD)is the creation of many dedicated researchers,program-mers,users,and authors.Let us remember their contributions.

Over the projected image he worked with a pointillist technique,using

in?nitesimal gradations of color,covering the whole spectrum

dot by dot,so that he always began from a blindingly bright

nucleus and ended at absolute black,or vice versa,depending on

the mystical or cosmological concept he wanted to express.

—Umberto Eco,Foucault’s Pendulum(1988) Lakeside,California David Salomon

Contents

Preface v 1Basic Theory1

1.1Points and Vectors1

1.2Parametric Blending10

1.3Parametric Curves11

1.4Properties of Parametric Curves13

1.5PC Curves18

1.6Curvature and Torsion26

1.7Special and Degenerate Curves35

1.8Basic Concepts of Surfaces35

1.9The Cartesian Product38

1.10Connecting Surface Patches40

1.11Fast Computation of a Bicubic Patch41

1.12Subdividing a Surface Patch43

1.13Surface Normals46

2Linear Interpolation49

2.1Straight Segments49

2.2Polygonal Surfaces53

2.3Bilinear Surfaces59

2.4Lofted Surfaces64

3Polynomial Interpolation71

3.1Four Points72

3.2The Lagrange Polynomial76

3.3The Newton Polynomial85

3.4Polynomial Surfaces87

3.5The Biquadratic Surface Patch87

3.6The Bicubic Surface Patch89

3.7Coons Surfaces93

3.8Gordon Surfaces108

xiv Contents

4Hermite Interpolation111

4.1Interactive Control112

4.2The Hermite Curve Segment113

4.3Degree-5Hermite Interpolation122

4.4Controlling the Hermite Segment123

4.5Truncating and Segmenting127

4.6Hermite Straight Segments129

4.7A Variant Hermite Segment131

4.8Ferguson Surfaces132

4.9Bicubic Hermite Patch134

4.10Biquadratic Hermite Patch137

5Spline Interpolation141

5.1The Cubic Spline Curve141

5.2The Quadratic Spline156

5.3The Quintic Spline158

5.4Cardinal Splines161

5.5Catmull–Rom Surfaces165

5.6Kochanek–Bartels Splines167

6B′e zier Approximation175

6.1The B′e zier Curve176

6.2The Bernstein Form of the B′e zier Curve178

6.3Fast Calculation of the Curve185

6.4Properties of the Curve190

6.5Connecting B′e zier Curves192

6.6The B′e zier Curve as a Linear Interpolation194

6.7Blossoming198

6.8Subdividing the B′e zier Curve202

6.9Degree Elevation205

6.10Reparametrizing the Curve207

6.11Cubic B′e zier Segments with Tension210

6.12An Interpolating B′e zier Curve:I212

6.13An Interpolating B′e zier Curve:II214

6.14Nonparametric B′e zier Curves217

6.15Rational B′e zier Curves217

6.16Rectangular B′e zier Surfaces219

6.17Subdividing Rectangular Patches224

6.18Degree Elevation225

6.19Nonparametric Rectangular Patches227

6.20Joining Rectangular B′e zier Patches228

6.21An Interpolating B′e zier Surface Patch230

6.22Rational B′e zier Surfaces232

6.23Triangular B′e zier Surfaces234

6.24Joining Triangular B′e zier Patches242

6.25Reparametrizing the B′e zier Surface246

6.26The Gregory Patch248

Contents xv

7B-Spline Approximation251

7.1The Quadratic Uniform B-Spline252

7.2The Cubic Uniform B-Spline256

7.3Multiple Control Points263

7.4Cubic B-Splines with Tension265

7.5Cubic B-Spline and B′e zier Curves268

7.6Higher-Degree Uniform B-Splines268

7.7Interpolating B-Splines270

7.8A Knot Vector-Based Approach271

7.9Recursive De?nitions of the B-Spline280

7.10Open Uniform B-Splines281

7.11Nonuniform B-Splines286

7.12Matrix Form of the Nonuniform B-Spline295

7.13Subdividing the B-spline Curve299

7.14Nonuniform Rational B-Splines(NURBS)302

7.15Uniform B-Spline Surfaces308

7.16Relation to Other Surfaces312

7.17An Interpolating Bicubic Patch315

7.18The Quadratic-Cubic B-Spline Surface317

8Subdivision Methods319

8.1Introduction319

8.2Chaikin’s Re?nement Method319

8.3Quadratic Uniform B-Spline by Subdivision325

8.4Cubic Uniform B-Spline by Subdivision327

8.5Biquadratic B-Spline Surface by Subdivision331

8.6Bicubic B-Spline Surface by Subdivision336

8.7Polygonal Surfaces by Subdivision341

8.8Doo Sabin Surfaces341

8.9Catmull–Clark Surfaces343

8.10Loop Surfaces344

9Sweep Surfaces347

9.1Sweep Surfaces348

9.2Surfaces of Revolution353

9.3An Alternative Approach355

9.4Skinned Surfaces360

A Conic Sections363

B Approximate Circles369

B.1Circles and B′e zier Curves369

B.2The Cubic B-Spline as a Circle373

C Graphics Gallery377

D Mathematica Notes381

Answers to Exercises387

xvi Contents

Bibliography447 Index451

My kind publishers announced,some time ago,a table of contents,

which included chapters on jay and?sh-hawk,panther,and

musquash,and a certain savage old bull moose that once took up his

abode too near my camp for comfort.My only excuse for their non-appearance is that my little book was full before their turn came.

They will?nd their place,I trust,in another volume presently.

—William J.Long,Secret of the Woods(1901)

空间曲线与曲面

实验七空间曲线与曲面 实验目的 1.掌握空间直线、平面的画法。 2.了解常见的空间曲线与曲面的画法。 与本实验相关的理论 最基本的空间作图函数是Plot3 ,用于作所有二元函数的三维立方体图形,其格式是: Plot3D[f,{x,xmin,xmax},{y,ymin,ymax},可选项] 由于很多曲面和绝大多数曲线都不能用显函数的形式表示。Mathematica 还提供了Parametric Plot3D参数作图函数,其格式是:Parametric Plot3D[{x[u,v],y[u,v] ,z[u,v]} ,{u,umin,umax},{v,vmin,vmax},可选项] Mathematica作三维图形的机理是先在XOY坐标面给定区域内计算出一系列格点的值,再用矩形“小瓦片”拟合张在上面的曲面上。因而如果曲面的表面变化复杂,可通过设置更细的“瓦片”分割来改善。这时候可增加选项PlotPoint―>n 来说明分割数n。 实验步骤 一、画空间曲线 注意空间曲线的参数方程只有一个参变量,如果要画出螺旋线 x=10cost , y=10sint , z=2t 的图形,只要输入: Parametric Plot3D[{10cos[t],10sin[t],2t} ,{t,0,20}] 空间直线也类似地处理。 例1:求过A(3,5,-2),B(3,5,-2)的直线方程,并画图。 分析:空间直线方程可由点向式写出,再改成参数式

) 2(4)2(535313----=--=--z y x 化为参数式是:t x 23-=,t y 25-=,t z 62+-= 输入:Parametric Plot3D[{3-2t ,5-2t ,-2+6t} ,{t ,0,1}] 二、画空间曲面 例2:求过A (1,0,0),B (0,2,0),C (0,0,3),的平面方程,并画图。 分析:平面方程可由截距式写出,y x z 2 333--=。 输入:Parametric Plot3D[{3-3x-3y/2} ,{x ,-1,1},{y ,-1,1}] 例3:画出二元函数22),(y x y x f +=的图形。 输入:Parametric Plot3D[{x^2+y^2} ,{x ,-4,4},{y ,-4,4}] 例4:画出椭球心在原点,3=a ,4=b ,5=c 的椭球面。 输入:Parametric Plot3D[{3*Cos[u] Cos[v], 4*Sin[u] Cos[v],5*Sin[v]} ,{u ,0,2Pi},{v ,-Pi/2,Pi/2}] 例5:画出以x y cos =为准线,母线平行于Z 轴的柱面。 输入:Parametric Plot3D[{x,Cos[x],z} ,{x ,-4,4},{z ,-4,4}] 例6:画出由平面曲线z x cos 1+=绕Z 轴放转而成的旋转面。 输入:Parametric Plot3D[{(1+Cos[u])Cos[v] ,(1+Cos[u])Sin[v] ,u} ,{u ,-Pi ,Pi},{v ,0,2Pi}] 例7:画单叶双曲面。 输入:Parametric Plot3D[{Sec[u]Cos[v] ,Sec[u]Sin[v] ,Tan[u]} ,{u ,-Pi/2+0.5,Pi/2-0.5},{v ,0,2Pi}]

实验2-空间曲线曲面图形的绘制

实验二空间曲线曲面图形的绘制 一、实验目的 熟练掌握使用Mathematica软件绘制空间曲线曲面图形的方法. 二、实验容与Mathematica命令 1.基本三维图形 函数(,) 的图形为三维空间的一个曲面,Mathematica中,绘制三维曲面图形的 z f x y 基本命令格式为 Plot3D[f,{x,xmin,xmax},{y,ymin,ymax},Options] 其中,f为一个二元显函数. 该命令有众多可供使用的选项,可执行命令“Options[Plot3D]”查询. 1)绘制曲面的基本方法 运行t1=Plot3D[Sin[x+y]*Cos[x+y],{x,0,4},{y,0,4}] 图1 2)用PlotRange 设定曲面的表面的变化围 运行Show[t1,PlotRange{-0.2,0.5}]

图2 3)坐标轴上加标记,并且在每个外围平面上画上网格 运行Show[t1,AxesLabel{"Time","Depth","Value"},FaceGrids All] 图 3 4)观察点的改变 将观察点改变在(2,-2,0),运行 Show[t1,ViewPoint{2,-2,0}]

图 4 也可用鼠标拖动改变视点。 5)无网格和立体盒子的曲面 运行 Show[t1,Mesh False,Boxed False] 图 5 6)没有阴影的曲面 利用Shading取消曲面的阴影运行 Show[t1,Shading False]

图 6 7)给曲面着色 Show[t1,Lighting False 图 7 Show[t1,Lighting None]

空间曲线地切线与空间曲面地切平面

第六节 空间曲线的切线与空间曲面的切平面 一、空间曲线的切线与法平面 设空间的曲线C 由参数方程的形式给出:?? ? ??===)()()(t z z t y y t x x ,),(βα∈t . 设),(,10βα∈t t ,)(),(),((000t z t y t x A 、))(),(),((111t z t y t x B 为曲线上两点,B A ,的连线AB 称为曲线C 的割线,当A B →时,若AB 趋于一条直线,则此直线称为曲线C 在点A 的切线. 如果)()()(t z z t y y t x x ===,,对于t 的导数都连续且不全为零(即空间的曲线C 为光滑曲线),则曲线在点A 切线是存在的.因为割线的方程为 ) ()() ()()()()()()(010010010t z t z t z z t y t y t y y t x t x t x x --=--=-- 也可以写为 010********)()() ()()()()()()(t t t z t z t z z t t t y t y t y y t t t x t x t x x ---=---=--- 当A B →时,0t t →,割线的方向向量的极限为{})(),(),(000t z t y t x ''',此即为切线的方向向量,所以切线方程为 ) () ()()()()(000000t z t z z t y t y y t x t x x '-='-='-. 过点)(),(),((000t z t y t x A 且与切线垂直的平面称为空间的曲线C 在点 )(),(),((000t z t y t x A 的法平面,法平面方程为 ))(())(())((00'00'00'=-+-+-z z t z y y t y x x t x 如果空间的曲线C 由方程为 )(),(x z z x y y == 且)(),(0' 0'x z x y 存在,则曲线在点)(),(,(000x z x y x A 的切线是 ) () ()()(100000x z x z z x y x y y x x '-= '-=- 法平面方程为

数学实验教程实验6(空间曲线与曲面

实验6 空间曲线与曲面 实验目的 1.学会利用软件命令绘制空间曲线和曲面 2.通过绘制一些常见曲线、曲面去观察空间曲线和曲面的特点 3.绘制多个曲面所围成的区域以及投影区域。 实验准备 1.复习常见空间曲线的方程 2.复习常见空间曲面的方程 实验内容 1.绘制空间曲线 2.绘制空间曲面:直角坐标方程、参数方程 3.旋转曲面的生成 4.空间多个曲面的所围成的公共区域以及投影区域 软件命令 表6-1 Matlab 空间曲线及曲面绘图命令 实验示例 【例6.1】绘制空间曲线 绘制空间曲线sin ,cos ,x at t y at t z ct ===,在区间09t π≤≤上的图形,这是一条锥面螺旋线,取a=10,c=3。

【程序】: t=0:pi/30:9*pi; a=10; c=3; x=a*t.*sin(t); y=a*t.*cos(t); z=c*t; plot3(x,y,z,’mo ’) 【输出】:见图6-1。 图6-1 空间曲线的绘制 【例6.2】利用多种命令绘制空间曲面 绘制二元函数 22 2 2 sin x y z x y += +在区域:99,99D x y -≤≤-≤≤上的图形。 【程序】:参见Exm06Demo02.m 。 【输出】:见图6-2。 图 6-2 绘制空间曲面 【例6.3】绘制Mobius 带 Mobius 带的参数方程为 122122 cos sin cos ,[0,2],[,] sin u u x r u y r u r c v u v a b z v π=??==+∈∈??=?,, 其中,,a b c 为常数,绘制其图形。

曲面与空间曲面的归纳

曲面与空间曲线的总结

曲面与空间曲线一.曲面及其方程: 1.曲面方程的一般概念: 定义:若曲面上的点的坐标(x,y,z) 都满足方程F(x,y,z)=0, 而满足此方程的点都在曲面上,则称此方程为 该曲面的方程,而曲面称为此方程的‘图形’。 例1:求与A(2,3,1)和B(4,5,6)等距离的点的运动规迹。 解: 设M(x,y,z)为动点的坐标,动点应满足的条件是 |AM|=|BM|由距离公式得 此即所求点的规迹方程,为一平面方程。 2.坐标面及与坐标面平行的平面方程: ①坐标平面xOy 的方程:z=0 ②过点(a,b,c)且与xOy 面平行的平面方程:z=c 222222)6()5()4()1()3()2(-+-+-=-+-+-z y x z y x 整理得 631044=-++z y x

③坐标面yOz 、坐标面zOx 以及过(a,b,c)点且分别与之平行的平面方程:x=0; y=0; x=a; y=b 3. 球面方程: ①球面的标准方程:以M0(x0,y0,z0)为球心,R 为半径 的球面方程为 (x-x0)2+(y-y0)2+(z-z0)2=R2 ②球面的一般方程: x2+y2+z2+Ax+By+Cz+D=0 球面方程的特点:平方项系数相同;没有交叉项。 例2:求x2+y2+z2+2x-2y-2=0表示的曲面 解:整理得: (x+1)2+(y-1)2+z2=22 故此为一个球心在(-1,1,0),半径为2的球。 4.母线平行于坐标轴的柱面方程: 一般我们将动直线l 沿定曲线c 平行移动所形成的轨迹 称为柱面。其中直线l 称为柱面的母线,定曲线c 称为柱面 的准线。本章中我们只研究母线平行于坐标轴的柱面方程。 此时有以下结论: 若柱面的母线平行于z 轴,准线c 是xOy 面上的一条曲线,其方程为F(x,y)=0,则该柱面的方程为F(x,y)=0; 同理,G(x,z)=0,H(y,z)=0在空间中分别表示母线平行于y 轴和x 轴的柱面。 分析:母线平行于坐标轴的柱面的特点为:平行于某轴,则在其方程中无此坐标项。其几何意义为:无论z 取何值,只要满足F(x,y)=0,则总在柱面上。 几种常见柱面:x+y=a 平面; 2 22a y x =+圆柱面

曲面与空间曲线的方程

第 2 章曲面与空间曲线的方程 本章教学目的:通过本章学习,使学生理解空间坐标系下曲面与空间曲线方程之定义及 表示,熟悉空间中一些特殊曲面、曲线的方程。 本章教学重点:空间坐标系下曲面与空间曲线方程的定义。 本章教学难点:(1)空间坐标系下母线平行于坐标轴的柱面方程与平面坐标系下有关平面 曲线方程的区别; ( 2)空间坐标系下,空间曲线一般方程的规范表示。 本章教学内容: § 1 曲面的方程 普通方程: 1 定义:设工为一曲面,F(x, y, z) =0为一三元方程,空间中建立了坐标系以后, 若工上任一点P(x,y,z)的坐标都满足F(x,y, z)=0,而且凡坐标满足方程的点都在曲 面工上,则称F (x, y, z) =0为工的普通方程,记作 2:F (x, y, z) =0. 不难看出,一点在曲面2上〈一〉该点的坐标满足工的方程,即曲面上的点与其 方程的解之间是一一对应的???》的方程的代数性质必能反映出2的几何性质。 2 三元方程的表示的几种特殊图形:空间中任一曲面的方程都是一三元方程,反之,是否任一三 元方程也表示空间中的一个曲面呢?一般而言这是成立的,但也有如下特殊情况 1 ° 若F( x, y, z) =0 的左端可分解成两个(或多个)因式F1( x, y, z) 与F2 (x, y, z)的乘积,即 F (x, y, z)= F i (x, y, z) F2 (x, y, z),贝U F (x , y , z) =0〈一〉F i (x , y , z) =0 或F2 (x , y , z) =0 ,此时 F( x y z) =0 表示两叶曲面1与 2 它们分别以F1( x y z) =0 F2( x y z) =0 为其方程此时称F(x y z)=0 表示的图形为变态曲面。如 F(x,y,z) xyz 0 即为三坐标面。 2 0方程F(x,y,z) (x2 y2 z2) x i2 y 2 2 (z 3)2 0 仅表示坐标原点和点( i 2 3) 3 °方程F(x, y,z) 0可能表示若干条曲线如 F(x, y,z) (x2 y2)(y2 z2) 0 即表示z 轴和x 轴 °方程F(x, y,z) 0不表示任何实图形如 4

空间曲线与曲面的绘制

空间曲线与曲面的绘制 本实验的目的是:利用数学软件Mathematica 绘制三维图形来观察空间曲线和空间曲面图形的特 点,以加强几何的直观性。 1. 空间曲线的绘制 绘制空间曲线时一般使用曲线的参数方程,利用命令“ParametricPlot3D ”如画出参数方程「x =x(t) * y = y(t) , h Et “2所确定的空间曲线的命令格式为: Z =z(t) ParametricPlot3D[{x[t],y[t],z[t]},{t,tmi n, tmax}, 选项] 例1 画出旋转抛物面z = x2y2与上半球面z = 1亠:1 - x2- y2交线的图形。 X = cost 解:它们的交线为平面z=1上的圆x2+y2=1,化为参数方程为*y = sint,t"O,勿],下面的 z = 1 mathematica命令就是作出它们的交线并把它存在变量p中: p ParametricPlot3D Cos t , Sin t , 1 , t, 0, 2 Pi 运行即得曲线如图1所示。 在这里说明一点,要作空间曲线的图形,必须先求出该曲线的参数 乍(x, y, z) =0 方程。如果曲线为一般式,其在xOy面上的投影柱面的

空间曲面与空间曲线学习总结

面及其方程 一曲面方程的概念 空间曲面可看做点的轨迹,而点的轨迹可由点的坐标所满足的方程来表达。因此,空间曲面可由方程来表示,反过来也成立。 为此,我们给出如下定义: 若曲面 S与三元方程 F x y z (,,) 0 (1) 有下述关系: 1、曲面 S上任一点的坐标均满足方程(1); 2、不在曲面 S上的点的坐标都不满足方程(1)。 那么,方程(1)称作曲面 S的方程,而曲面S称作方程(1)的图形。 下面,我们来建立几个常见的曲面方程。 【例1】球心在点 ) , , ( z y x M ,半径为R的球面方程。

解:设M x y z (,,)是球面上的任一点,那么M M R 0=, 即: ()()()x x y y z z R -+-+-=020202 ()()()x x y y z z R -+-+-=0202022 (2) (2)式就是球面上任一点的坐标所满足的方程。 反过来,不在球面上的点 ''''M x y z (,,),'M 到M 0的距离M M R 0'≠, 从而点 'M 的坐标不适合于方程(2)。 故方程(2)就是以 M x y z 0000(,,)为球心,R 为半径的球面方程。 若球心在原点,即 M x y z O 0000000(,,)(,,)=,其球面方程为 x y z R 2222++= 【例2】设有点A (,,)123和B (,,)214-,求线段AB 垂直平分面π 的方程。 解:所求平面π是与A 和B 等距离的点的几何轨迹,设M x y z (,,)是所求平面上任意 的一点,则 AM BM = 即: ()()()()()()x y z x y z -+-+-=-+++-123214222222

曲面与空间曲线的方程

第2章 曲面与空间曲线的方程 本章教学目的:通过本章学习,使学生理解空间坐标系下曲面与空间曲线方程之定 义及表示,熟悉空间中一些特殊曲面、曲线的方程。 本章教学重点:空间坐标系下曲面与空间曲线方程的定义。 本章教学难点:(1)空间坐标系下母线平行于坐标轴的柱面方程与平面坐标系下有 关平面曲线方程的区别; (2)空间坐标系下,空间曲线一般方程的规范表示。 本章教学内容: §1 曲面的方程 一 普通方程: 1 定义:设Σ为一曲面,F (x ,y ,z )=0为一三元方程,空间中建立了坐标系以后, 若Σ上任一点P (x ,y ,z )的坐标都满足F (x ,y ,z )=0,而且凡坐标满足方程的点都在曲面Σ上,则称F (x ,y ,z )=0为Σ的普通方程,记作 Σ:F (x ,y ,z )=0. 不难看出,一点在曲面Σ上〈═〉该点的坐标满足Σ的方程,即曲面上的点与其方程的解之间是一一对应的 ∴Σ的方程的代数性质必能反映出Σ的几何性质。 2 三元方程的表示的几种特殊图形: 空间中任一曲面的方程都是一三元方程,反之,是否任一三元方程也表示空间中的 一个曲面呢?一般而言这是成立的,但也有如下特殊情况 1° 若F (x ,y ,z )=0的左端可分解成两个(或多个)因式F 1(x ,y ,z ) 与F 2(x ,y ,z )的乘积,即F (x ,y ,z )≡F 1(x ,y ,z )F 2(x ,y ,z ),则 F (x ,y ,z )=0〈═〉F 1(x ,y ,z )=0或F 2(x ,y ,z )=0,此时 F (x ,y ,z )=0表示两叶曲面1∑与2∑,它们分别以F 1(x ,y ,z )=0,F 2(x ,y ,z )=0为其方程,此时称F (x ,y ,z )=0表示的图形为变态曲面。如 0),,(=≡xyz z y x F 即为三坐标面。 20方程()()[] 0)3(21)(),,(222222=-+-+-++≡z y x z y x z y x F 仅表示坐标原点和点(1,2,3) 3°方程0),,(=z y x F 可能表示若干条曲线,如 0))((),,(2 222=++≡z y y x z y x F 即表示z 轴和x 轴 4°方程0),,(=z y x F 不表示任何实图形,如

§7.4.1-3空间曲面和空间曲线

§7.4空间曲面和空间曲线 本节以两种方式来讨论空间曲面: (1)已知曲面的形状,建立这曲面的方程; (2)已知一个三元方程,研究这方程的图形。 7.4.1球面与柱面 (一)球面 空间中与一定点等距离的点的轨迹叫球面。 求球心在点),,( z y x M ,半径为R 的球面方程。 设),,(z y x M 为球面上的任一点,则有R M M = ,即 R z z y y x x =-+-+-222)()()( ,化简得: 2222)()()(R z z y y x x =-+-+- 。 ① 满足方程①,因此,方程①是球面的方程。 当0=== z y x 时,即球心在原点的球面方程为 2 222R z y x =++。 ② 例1.指出方程05642222=+--+++z y x z y x 表示何种曲面。 解:9415964412222+++-=+-++-+++z z y y x x , 22223)3()2()1(=-+-++z y x ,方程表示以)3 ,2 ,1(-为球心,3为半径的球面。 (二)柱面 动直线L 沿给定曲线C 平行移动所形成的曲面,称为柱面。动直线L 称为柱面的母线,定曲线C 称为柱面的准线。 y

现在来建立以xoy 面上的曲线C :? ??== . 0, 0),(z y x F 为准线,平行于L z 轴的直线 设) ,,( z y x M 为柱面上任一点,过 M 作平行于轴的直线 z ,交xoy 面于点 ) 0 , ,( y x M ,由柱面定义可知点上必在准线C M 。故有0),(= y x F 。由于 M M 与点点有相同的横坐标和纵坐标,故的坐标点 M 也必满足方程 0),(=y x F 。反之,如果空间一点) ,,( z y x M 满足方程0),(=y x F ,即0 ),(= y x F ,故 ) ,,( z y x M 且与轴平行的直线 z 必通过 上的点准线C ) 0 , ,( y x M ,即) 0 , ,( y x M 在过) 0 , ,( y x M 的母线上,于是) ,,( z y x M 必在柱面上,因此方程0),(=y x F 表示平行于轴的柱面 z 。 一般地 方程0) ,(=y x F 表示母线轴的柱面平行于 z ; 方程0) ,(=z y H 表示母线轴的柱面平行于 x ; 方程0) ,(=z x G 表示母线轴的柱面平行于 y 。 以二次曲线为准线的柱面称为二次柱面。 例如:方程2 2 2 a y x =+表示圆柱面;方程 12 22 2=+ b y a x 表示椭圆柱面; 方程12 2 22 =- b x a y 表示双曲柱面;方程Py x 22=表示抛物柱面。 y 22 a y = x x y 1 2 2=b y

空间曲线的切线与空间曲面的切平面之欧阳光明创编

第六节空间曲线的切线与空间曲面 的切平面 欧阳光明(2021.03.07) 一、空间曲线的切线与法平面 设空间的曲线C 由参数方程的形式给出:?? ???===)()()(t z z t y y t x x ,),(βα∈t . 设),(,10βα∈t t ,)(),(),((000t z t y t x A 、))(),(),((111t z t y t x B 为曲线上两点,B A ,的连线AB 称为曲线C 的割线,当A B →时,若AB 趋于一条直线,则此直线称为曲线C 在点A 的切线. 如果)()()(t z z t y y t x x ===,,对于t 的导数都连续且不全为零(即空间的曲线C 为光滑曲线),则曲线在点A 切线是存在的.因为割线的方程为 也可以写为 当A B →时,0t t →,割线的方向向量的极限为{})(),(),(000t z t y t x ''',此即为切线的方向向量,所以切线方程为 )()()()()()(000000t z t z z t y t y y t x t x x '-='-='-. 过点)(),(),((000t z t y t x A 且与切线垂直的平面称为空间的曲线C 在点)(),(),((000t z t y t x A 的法平面,法平面方程为 如果空间的曲线C 由方程为 且)(),(0'0'x z x y 存在,则曲线在点)(),(,(000x z x y x A 的切线是 法平面方程为

如果空间的曲线C 表示为空间两曲面的交,由方程组 确定时,假设在),,(000z y x A 有0),(),(≠??=A z y G F J ,在),,(000z y x A 某邻域内满足隐函数组存在定理条件,则由方程组 ? ??==0),,(0),,(z y x G z y x F ,在点),,(000z y x A 附近能确定隐函数 有)(),(0000x z z x y y ==,) ,(),(1,),(),(1x y G F J dx dz z x G F J dx dy ??-=??-=。于是空间的曲线C 在 点),,(000z y x A 的切线是 即 法平面方程为 类似地,如果在点),,(000z y x A 有0),(),(≠??A y x G F 或0),(),(≠??A x z G F 时,我们得到的切线方程和法平面方程有相同形式。 所以,当向量 时,空间的曲线C 在),,(000z y x A 的切线的方向向量为r 例6.32 求曲线θθθb z a y a x ===,sin ,cos 在点()πb a ,0,-处的切线方程. 解 当πθ=时,曲线过点()πb a ,0,-,曲线在此点的切线方向向量为 {}{}b a b a a ,,0|,cos ,sin -=-=πθθθ, 所以曲线的切线方程为 b t z z a t y y t x x )()(0)(000-=--=-.

相关文档
最新文档