Instant ebooks textbook Calculus for computer graphics, 3rd edition john vince download all chapters

Page 1


Calculus for Computer Graphics, 3rd Edition John

Vince

Visit to download the full and correct content document: https://ebookmass.com/product/calculus-for-computer-graphics-3rd-edition-john-vince /

More products digital (pdf, epub, mobi) instant download maybe you interests ...

Mathematics for Computer Graphics (Undergraduate Topics in Computer Science), 6th Edition 2022 John Vince

https://ebookmass.com/product/mathematics-for-computer-graphicsundergraduate-topics-in-computer-science-6th-edition-2022-johnvince/

Foundation Mathematics for Computer Science: A Visual Approach 3rd Edition John Vince

https://ebookmass.com/product/foundation-mathematics-forcomputer-science-a-visual-approach-3rd-edition-john-vince/

Quaternions for Computer Graphics

https://ebookmass.com/product/quaternions-for-computer-graphics-c h%e8%ae%a1%e7%ae%97%e6%9c%ba%e5%9b%be%e5%bd%a2%e5%ad%a6%e4%b8%ad%e

john-vince-%e9%83%ad%e9%a3%9e/

Complete Guide to

Graphics:

Modeling and Animation: Volume1 9th Edition John M. Blain

https://ebookmass.com/product/the-complete-guide-to-blendergraphics-computer-modeling-and-animation-volume1-9th-editionjohn-m-blain/

Computer graphics with Open GL. 4th Edition Donald D. Hearn

https://ebookmass.com/product/computer-graphics-with-open-gl-4thedition-donald-d-hearn/

The Complete Guide to Blender Graphics: Computer Modeling and Animation: Volume 2 9th Edition John M. Blain

https://ebookmass.com/product/the-complete-guide-to-blendergraphics-computer-modeling-and-animation-volume-2-9th-editionjohn-m-blain/

Solutions to Calculus for JEE (Advanced), 3rd edition

G. Tewani

https://ebookmass.com/product/solutions-to-calculus-for-jeeadvanced-3rd-edition-g-tewani/

Calculus II 3rd Edition Mark Zegarelli

https://ebookmass.com/product/calculus-ii-3rd-edition-markzegarelli/

Differential Calculus for JEE Main and Advanced (3rd edition) Vinay Kumar

https://ebookmass.com/product/differential-calculus-for-jee-mainand-advanced-3rd-edition-vinay-kumar/

Calculus for Computer Graphics

Third Edition

CalculusforComputerGraphics

JohnVince CalculusforComputer Graphics

ThirdEdition

ISBN978-3-031-28116-7ISBN978-3-031-28117-4(eBook) https://doi.org/10.1007/978-3-031-28117-4

1st edition:©Springer-VerlagLondon2013

2nd &3rd editions:©SpringerNatureSwitzerlandAG2019,2023

Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpartof thematerialisconcerned,specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation, broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,andtransmissionorinformation storageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilarmethodology nowknownorhereafterdeveloped.

Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant protectivelawsandregulationsandthereforefreeforgeneraluse.

Thepublisher,theauthors,andtheeditorsaresafetoassumethattheadviceandinformationinthisbook arebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsor theeditorsgiveawarranty,expressedorimplied,withrespecttothematerialcontainedhereinorforany errorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictional claimsinpublishedmapsandinstitutionalaffiliations.

ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland

Preface

Calculusisoneofthosesubjectsthatappearstohavenoboundaries,whichiswhy somebooksaresolargeandheavy!SowhenIstartedwritingthefirsteditionofthis book,Iknewthatitwouldnotfallintothiscategory.Itwouldbearound200pages longandtakethereaderonagentlejourneythroughthesubject,withoutplacingtoo manydemandsontheirknowledgeofmathematics.

Thesecondeditionreviewedtheoriginaltext,correctedafewtypos,andincorporatedthreeextrachapters.Ialsoextendedthechapteronarclengthtoincludethe parameterisationofcurves.

Inthisthirdedition,Ihavereviewedthetext,correctedafewtypos,and incorporatednewchaptersonvectordifferentialoperatorsandsolvingdifferential equations.

Theobjectiveofthebookremainsthesame:toinformthereaderaboutfunctions andtheirderivatives,andtheinverseprocess:integration,whichcanbeusedfor computingareaandvolume.Theemphasisongeometrygivesthebookrelevance tothecomputergraphicscommunityandhopefullywillprovidethemathematical backgroundforprofessionalsworkingincomputeranimation,gamesandallieddisciplinestoreadandunderstandotherbooksandtechnicalpaperswherethedifferential andintegralnotationisfound.

Thebookdividesinto18chapters,withtheobligatorychapterstointroduceand concludethebook.Chapter 2 reviewstheideasoffunctions,theirnotationandthe differenttypesencounteredineverydaymathematics.Thiscanbeskippedbyreaders alreadyfamiliarwiththesubject.

Chapter 3 introducestheideaoflimitsandderivatives,andhowmathematicians haveadoptedlimitsinpreferencetoinfinitesimals.Mostauthorsintroduceintegration asaseparatesubject,butIhaveincludeditinthischaptersothatitisseenasan antiderivative,ratherthansomethingindependent.

Chapter 4 looksatderivativesandantiderivativesforawiderangeoffunctions suchaspolynomial,trigonometric,exponentialandlogarithmic.Italsoshowshow functionsums,products,quotientsandfunctionofafunctionaredifferentiated.

Chapter 5 covershigherderivativesandhowtheyareusedtodetectalocal maximumandminimum.

Chapter 6 coverspartialderivatives,whichalthougheasytounderstand,havea reputationforbeingdifficult.Thisispossiblyduetothesymbolsused,ratherthan theunderlyingmathematics.Thetotalderivativeisintroducedhereasitisrequired inalaterchapter.

Chapter 7 introducesthestandardtechniquesforintegratingdifferenttypesof functions.Thiscanbealargesubject,andIhavedeliberatelykepttheexamples simple,inordertokeepthereaderinterestedandontopofthesubject.

Chapter 8 showshowintegrationrevealstheareaunderagraphandtheconcept oftheRiemannSum.Theideaofrepresentingareaorvolumeasthelimitingsumof somefundamentalunitsiscentraltounderstandingcalculus.

Chapter 9 dealswitharclength,andusesavarietyofworkedexamplestocompute thelengthofdifferentcurvesandtheirparameterisation

Chapter 10 showshowsingleanddoubleintegralsareusedtocomputethesurface areaofdifferentobjects.ItisalsoaconvenientpointtointroduceJacobians,which, hopefully,Ihavemanagedtoexplainconvincingly.

Chapter 11 showshowsingle,doubleandtripleintegralsareusedtocompute thevolumeoffamiliarobjects.Italsoshowshowthechoiceofacoordinatesystem influencesasolution’scomplexity.

Chapter 12 coversvector-valuedfunctions,andprovidesashortintroductionto thisverylargesubject.

Chapter 13 isnew,andcoversthreedifferentialoperators:grad,divandcurl.

Chapter 14 showshowtocalculatetangentandnormalvectorsforavarietyof curvesandsurfaces,whichareusefulinshadingalgorithmsandphysically-based animation.

Chapter 15 showshowdifferentialcalculusisusedtomanagegeometriccontinuity inB-splinesandBéziercurves.

Chapter 16 looksatthecurvatureofcurvessuchasacircle,helix,parabolaand parametricplanecurves.Italsoshowshowtocomputethecurvatureof2Dquadratic andcubicBéziercurves.

Chapter 17 isnew,andexploresafewtechniquesforsolvingfirst-orderdifferential equations.

IusedSpringer’sexcellentauthor’s LATEX developmentkitonmyAppleiMac, whichissofastthatIcreateanentirebookin3or4seconds,justtochangeasingle character!Thisbookcontainsaroundtwohundredcolourillustrationstoprovide astrongvisualinterpretationforderivatives,antiderivativesandthecalculationof arclength,curvature,tangentvectors,areaandvolume.IusedApple’s Grapher applicationformostofthegraphsandrenderedimages,and Pages forthediagrams.

ThereisnowayIcouldhavewrittenthisbookwithouttheInternetandseveral excellentbooksoncalculus.OneonlyhastoGoogle‘WhatisaJacobian?’toreceive overathousandentriesinabout1second!YouTubealsocontainssomehighlyinformativepresentationsonvirtuallyeveryaspectofcalculusonecouldwant.SoIhave spentmanyhourswatching,absorbinganddisseminatingvideos,lookingforvital piecesofinformationthatarekeytounderstandingatopic.

ThebooksIhavereferredtoinclude: TeachYourselfCalculus byHughNeil, CalculusofOneVariable byKeithHirst, InsideCalculus byGeorgeExner, Short

Calculus bySergeLang, DifferentialEquations byAllanStruthersandMerlePotter, andmyall-timefavourite: MathematicsfromtheBirthofNumbers byJanGullberg. Iacknowledgeandthankalltheseauthorsfortheinfluencetheyhavehadonthis book.Oneotherbookthathashelpedmeis DigitalTypographyUsing LATEX by ApostolosSyropoulos,AntonisTsolomitisandNickSofroniou.

Writinganybookcanbealonelyactivity,andfindingsomeonewillingtoreadan earlydraft,andwhoseopiniononecantrust,isextremelyvaluable.Consequently,I thankDr.TonyCrillyforhisvaluablefeedbackafterreadingtheoriginalmanuscript. Tonyidentifiedflawsinmyreasoningandinconsistentnotation,andIhaveincorporatedhissuggestions.However,Itakefullresponsibilityforanymistakesthatmay havefoundtheirwayintothispublication.

Finally,IthankHelenDesmond,EditorforComputerScience,SpringerUK,for hercontinuingprofessionalsupport.

Breinton,Herefordshire,UK February2023

JohnVince

1Introduction ..................................................1

1.1WhatIsCalculus?........................................1

1.2WhereIsCalculusUsedinComputerGraphics?..............2

1.3WhoElseShouldReadThisBook?.........................3

1.4WhoInventedCalculus?...................................3

2Functions .....................................................5

2.1Introduction.............................................5

2.2Expressions,Variables,ConstantsandEquations..............5

2.3Functions...............................................6

2.3.1ContinuousandDiscontinuousFunctions.............7

2.3.2LinearGraphFunctions............................8

2.3.3PeriodicFunctions................................9

2.3.4PolynomialFunctions.............................10

2.3.5FunctionofaFunction.............................10

2.3.6OtherFunctions..................................11

2.4AFunction’sRateofChange...............................11

2.4.1SlopeofaFunction...............................11

2.4.2DifferentiatingPeriodicFunctions...................15

2.5Summary...............................................18

3LimitsandDerivatives .........................................19

3.1Introduction.............................................19 3.2SomeHistoryofCalculus.................................19

3.3SmallNumericalQuantities................................20

3.4EquationsandLimits.....................................21

3.4.1QuadraticFunction................................21

3.4.2CubicEquation...................................23

3.4.3FunctionsandLimits..............................25

3.4.4GraphicalInterpretationoftheDerivative............26

3.4.5DerivativesandDifferentials.......................27

3.4.6IntegrationandAntiderivatives.....................29

3.6.1LimitingValueofaQuotient1......................31

3.6.2LimitingValueofaQuotient2......................32

3.6.3Derivative.......................................32

3.6.4SlopeofaPolynomial.............................33

3.6.5SlopeofaPeriodicFunction........................33

3.6.6IntegrateaPolynomial.............................34

4DerivativesandAntiderivatives

4.1Introduction.............................................35

4.2DifferentiatingGroupsofFunctions.........................36

4.2.1SumsofFunctions................................36 4.2.2FunctionofaFunction.............................38 4.2.3FunctionProducts................................42

4.2.4FunctionQuotients................................45

4.2.5Summary:GroupsofFunctions.....................47

4.3DifferentiatingImplicitFunctions...........................48

4.4DifferentiatingExponentialandLogarithmicFunctions........52

4.4.1ExponentialFunctions.............................52

4.4.2LogarithmicFunctions.............................54

4.4.3Summary:ExponentialandLogarithmicFunctions....56

4.5DifferentiatingTrigonometricFunctions.....................57

4.5.1Differentiatingtan................................57

4.5.2Differentiatingcsc................................58

4.5.3Differentiatingsec................................59

4.5.4Differentiatingcot................................60

4.5.5Differentiatingarcsin,arccosandarctan..............61

4.5.6Differentiatingarccsc,arcsecandarccot..............62

4.5.7Summary:TrigonometricFunctions.................63

4.6DifferentiatingHyperbolicFunctions........................63

4.6.1Differentiatingsinh,coshandtanh..................66

4.6.2Differentiatingcosech,sechandcoth................68

4.6.3Differentiatingarsinh,arcoshandartanh.............70

4.6.4Differentiatingarcsch,arsechandarcoth.............72

4.6.5Summary:HyperbolicFunctions....................73

4.7Summary...............................................73

5HigherDerivatives ............................................75

5.1Introduction.............................................75

5.2HigherDerivativesofaPolynomial.........................75

5.3IdentifyingaLocalMaximumorMinimum..................78

5.4DerivativesandMotion...................................81

5.5Summary...............................................84

5.5.1SummaryofFormulae.............................84

6PartialDerivatives ............................................85

6.1Introduction.............................................85

6.2PartialDerivatives........................................85

6.2.1VisualisingPartialDerivatives......................88

6.2.2MixedPartialDerivatives..........................89

6.3ChainRule..............................................92

6.4TotalDerivative..........................................94

6.5Second-OrderandHigherPartialDerivatives.................95

6.6Summary...............................................95

6.6.1SummaryofFormulae.............................95

6.7WorkedExamples........................................96

6.7.1PartialDerivative.................................96

6.7.2FirstandSecond-OrderPartialDerivatives...........96

6.7.3MixedPartialDerivative...........................97

6.7.4ChainedPartialDerivatives.........................97

6.7.5TotalDerivative..................................98

7IntegralCalculus ..............................................101

7.1Introduction.............................................101

7.2IndefiniteIntegral........................................101

7.3StandardIntegrationFormulae.............................102

7.4IntegratingTechniques....................................102

7.4.1ContinuousFunctions.............................102

7.4.2DifficultFunctions................................104

7.4.3TrigonometricIdentities...........................104

7.4.4ExponentNotation................................108

7.4.5CompletingtheSquare............................108

7.4.6TheIntegrandContainsaDerivative.................110

7.4.7ConvertingtheIntegrandintoaSeriesofFractions....113

7.4.8IntegrationbyParts...............................114

7.4.9IntegratingbySubstitution.........................122

7.4.10PartialFractions..................................126

7.5Summary...............................................129

7.6WorkedExamples........................................130

7.6.1TrigonometricIdentities...........................130

7.6.2ExponentNotation................................130

7.6.3CompletingtheSquare............................130

7.6.4TheIntegrandContainsaDerivative.................131

7.6.5ConvertingtheIntegrandintoaSeriesofFractions....131

7.6.6IntegrationbyParts...............................132

7.6.7IntegratingbySubstitution.........................132

7.6.8PartialFractions..................................133

8AreaUnderaGraph

8.2CalculatingAreas........................................135

8.3PositiveandNegativeAreas...............................143

8.4AreaBetweenTwoFunctions..............................145

8.5Areaswiththe y -Axis.....................................147

8.6AreawithParametricFunctions............................148

8.7BernhardRiemann.......................................150

8.7.1DomainsandIntervals.............................150

8.7.2TheRiemannSum................................151

8.8Summary...............................................152

9.3.1ArcLengthofaStraightLine.......................156

9.3.2ArcLengthofaCircle.............................156

9.3.3ArcLengthofaParabola..........................157

9.3.4ArcLengthof y = x 3 2 .............................161

9.3.5ArcLengthofaSineCurve........................162

9.3.6ArcLengthofaHyperbolicCosineFunction.........163

9.3.7ArcLengthofParametricFunctions.................164

9.3.8ArcLengthofaCircle.............................165

9.3.9ArcLengthofanEllipse...........................166

9.3.10ArcLengthofaHelix.............................167

9.3.11ArcLengthofa2DQuadraticBézierCurve..........168

9.3.12ArcLengthofa3DQuadraticBézierCurve..........170

9.3.13ArcLengthParameterisationofa3DLine............172

9.3.14ArcLengthParameterisationofaHelix..............175

9.3.15PositioningPointsonaStraightLineUsing aSquareLaw....................................176

9.3.16PositioningPointsonaHelixCurveUsing aSquareLaw....................................178

9.3.17ArcLengthUsingPolarCoordinates.................179

9.4Summary...............................................182

9.4.1SummaryofFormulae.............................182

9.5WorkedExamples........................................183

9.5.1ArcLengthofaStraightLine.......................183

9.5.2ArcLengthofaCircle.............................184

9.5.3ArcLengthof y = 2 x 3 2 ............................184

9.5.4ArcLengthofaHelix.............................185 References....................................................186

10SurfaceArea ..................................................187

10.2.1SurfaceAreaofaCylinder.........................189

10.2.2SurfaceAreaofaRightCone.......................189

10.2.3SurfaceAreaofaSphere...........................192

10.2.4SurfaceAreaofaParaboloid.......................193

10.3SurfaceAreaUsingParametricFunctions....................195 10.4DoubleIntegrals.........................................197 10.5Jacobians...............................................198

10.7.1SummaryofFormulae.............................210 10.8WorkedExamples........................................212

10.8.1SurfaceAreaofaCylinder.........................212

10.8.2SurfaceAreaSweptOutbyaFunction...............212

10.8.3DoubleIntegrals..................................213

11.1Introduction.............................................215

11.2SolidofRevolution:Disks.................................215

11.2.1VolumeofaCylinder..............................216

11.2.2VolumeofaRightCone...........................217

11.2.3VolumeofaRightConicalFrustum.................219

11.2.4VolumeofaSphere...............................221

11.2.5VolumeofanEllipsoid............................221

11.2.6VolumeofaParaboloid............................223

11.3SolidofRevolution:Shells................................224

11.3.1VolumeofaCylinder..............................225

11.3.2VolumeofaRightCone...........................226

11.3.3VolumeofaHemisphere...........................227

11.3.4VolumeofaParaboloid............................228

11.4VolumeswithDoubleIntegrals.............................229

11.4.1ObjectswithaRectangularBase....................231

11.4.2RectangularBox..................................231

11.4.3RectangularPrism................................232

11.4.4CurvedTop......................................233

11.4.5ObjectswithaCircularBase.......................234

11.4.6Cylinder.........................................234

11.4.7TruncatedCylinder...............................235

11.5VolumeswithTripleIntegrals..............................236 11.5.1RectangularBox..................................237

11.5.2VolumeofaCylinder..............................238

11.5.3VolumeofaSphere...............................241

11.5.4VolumeofaCone.................................242 11.6Summary...............................................243

11.6.1SummaryofFormulae.............................243

11.7WorkedExamples........................................244

11.7.1VolumeofaCylinder..............................244

11.7.2VolumeofaRightCone...........................245

11.7.3QuadraticRectangularPrism.......................245 11.7.4CurvedTop......................................246

11.7.5CylinderwithaCurvedTop........................248

12Vector-ValuedFunctions .......................................249 12.1Introduction.............................................249

12.2DifferentiatingVectorFunctions............................249

12.2.1VelocityandSpeed................................250

12.2.2Acceleration.....................................252

12.2.3RulesforDifferentiatingVector-ValuedFunctions.....252

12.3IntegratingVector-ValuedFunctions........................253

12.3.1DistanceFallenbyanObject.......................254

12.3.2PositionofaMovingObject........................255 12.4Summary...............................................255

12.4.1SummaryofFormulae.............................255

12.5.1DifferentiatingaPositionVector....................256

12.5.2SpeedofanObjectatDifferentTimes...............257

12.5.3VelocityandAccelerationofanObject atDifferentTimes................................257

12.5.4DistanceFallenbyanObject.......................258 12.5.5PositionofaMovingObject........................258

13.4.1GradientofaScalarFieldin

13.4.3SurfaceNormalVectors............................270

13.8WorkedExamples........................................281

13.8.1GradientofaScalarField..........................281

13.8.2NormalVectortoanEllipse........................281

13.8.3DivergenceofaVectorField.......................283

13.8.4CurlofaVectorField.............................283

14TangentandNormalVectors ...................................285

14.1Introduction.............................................285

14.2Notation................................................285

14.3TangentVectortoaCurve.................................286

14.4NormalVectortoaCurve.................................288

14.4.1UnitTangentandNormalVectorstoaLine...........290

14.4.2UnitTangentandNormalVectorstoaParabola.......292

14.4.3UnitTangentandNormalVectorstoaCircle..........294

14.4.4UnitTangentandNormalVectorstoanEllipse........296

14.4.5UnitTangentandNormalVectorstoaSineCurve.....298

14.4.6UnitTangentandNormalVectorstoaCoshCurve.....300

14.4.7UnitTangentandNormalVectorstoaHelix..........302

14.4.8UnitTangentandNormalVectorstoaQuadratic BézierCurve.....................................303

14.5UnitTangentandNormalVectorstoaSurface................306

14.5.1UnitNormalVectorstoaBilinearPatch..............306

14.5.2UnitNormalVectorstoaQuadraticBézierPatch......307

14.5.3UnitTangentandNormalVectortoaSphere..........310

16.2.4ParametricPlaneCurve............................335

16.2.5CurvatureofaGraph..............................337

16.2.6Curvatureofa2DQuadraticBézierCurve............338

16.2.7Curvatureofa2DCubicBézierCurve...............339

16.4.1CurvatureofaCircle..............................342

16.4.2CurvatureofaHelix..............................342 17SolvingDifferentialEquations

17.2WhatIsaDifferentialEquation?............................343 17.3BasicConcepts..........................................344

17.5.2CompoundInterest................................355

17.5.3RadiocarbonDating...............................357

Chapter1 Introduction

1.1WhatIsCalculus?

Whatiscalculus?Wellthisisaneasyquestiontoanswer.Basically,calculushas twoparts: differential and integral.Differentialcalculusisusedforcomputinga function’srateofchangerelativetooneofitsarguments.Generally,onebeginswith afunctionsuchas f ( x ),andas x changes,acorrespondingchangeoccursin f ( x ). Differentiatingf ( x ) withrespectto x ,producesasecondfunction f ( x ),whichgives therateofchangeof f ( x ) forany x .Forexample,andwithoutexplainingwhy,if f ( x ) = x 2 ,then f ( x ) = 2 x ,andwhen x = 3, f ( x ) ischanging2 × 3 = 6times fasterthan x .Whichisratherneat!

Inpractice,onealsowrites y = x 2 ,oreven y = f ( x ),whichmeansthatdifferentiatingisexpressedinavarietyofways

thusfor y = f ( x ) = x 2 ,wecanwrite

Integralcalculusreversestheoperation,where integratingf ( x ),produces f ( x ), orsomethingsimilar.Butsurely,calculuscan’tbeaseasyasthis,you’reasking yourself?Well,therearesomeproblems,whichiswhatthisbookisabout.Tobegin with,notallfunctionsareeasilydifferentiated,astheymaycontainhiddeninfinities anddiscontinuities.Somefunctionsareexpressedasproductsorquotients,andmany functionspossessmorethanoneargument.Allthese,andotherconditions,mustbe addressed.Furthermore,integratingafunctionproducessomeusefulbenefits,such ascalculatingtheareaunderagraph,thelengthofcurves,andthesurfaceareaand volumeofobjects.Butmoreofthislater.

©SpringerNatureSwitzerlandAG2023 J.Vince, CalculusforComputerGraphics, https://doi.org/10.1007/978-3-031-28117-4_1

Butwhyshouldwebeinterestedinratesofchange?Well,saywehaveafunction thatspecifiesthechangingvelocityofanobjectovertime,thendifferentiatingthe functiongivestherateofchangeofthefunctionovertime,whichistheobject’s acceleration.Andknowingtheobject’smassandacceleration,wecancomputethe forceresponsiblefortheobject’sacceleration.Therearemanymorereasonsfor havinganinterestinratesofchange,whichwillemergeinthefollowingchapters.

1.2WhereIsCalculusUsedinComputerGraphics?

Ifyouarelucky,youmayworkincomputergraphicswithouthavingtousecalculus, butsomepeoplehavenochoicebuttounderstandit,anduseitintheirwork.For example,weoftenjointogethercurvedlinesandsurfaces.Figure 1.1 showstwo abuttingcurves,wherethejoinisclearlyvisible.Thisisbecausetheslopeinformation attheendofthefirstcurve,doesnotmatchtheslopeinformationatthestartofthe secondcurve.Byexpressingthecurvesasfunctions,differentiatingthemgivestheir slopesatanypointintheformoftwootherfunctions.Theseslopefunctionscanalso bedifferentiated,andbyensuringthattheoriginalcurvespossessthesamederivatives atthejoin,aseamlessjoiniscreated.Thesameprocessisusedforabuttingtwoor moresurfacepatches.

Calculusfindsitswayintootheraspectsofcomputergraphicssuchasdigital differentialanalysers(DDAs)fordrawinglinesandcurves,interpolation,curvature, arc-lengthparametrisation,fluidanimation,rendering,animation,modelling,etc.In laterchaptersIwillshowhowcalculuspermitsustocalculatesurfacenormalsto curvesandsurfaces,andthecurvatureofdifferentcurves.

Fig.1.1 Twoabutting curveswithoutmatching slopes

1.3WhoElseShouldReadThisBook?

Whoelseshouldreadthisbook?Iwouldsaythatalmostanyonecouldreadthisbook. Basically,calculusisneededbymathematicians,scientists,physicists,engineers, etc.,andthisbookisjustanintroductiontothesubject,withabiastowardscomputer graphics.

1.4WhoInventedCalculus?

Morethanthree-hundredyearshavepassedsincetheEnglishastronomer,physicist andmathematicianIsaacNewton(1643–1727)andtheGermanmathematicianGottfriedLeibniz(1646–1716)publishedtheirtreatiesdescribingcalculus.Socalled ‘infinitesimals’playedapivotalroleinearlycalculustodeterminetangents,areaand volume.Incorporatingincrediblysmallquantities(infinitesimals)intoanumerical solution,meansthatproductsinvolvingthemcanbeignored,whilstquotientscould beretained.Thefinalsolutiontakestheformofaratiorepresentingthechangeofa function’svalue,relativetoachangeinitsindependentvariable.

Althoughinfinitesimalquantitieshavehelpedmathematiciansformorethantwothousandyearssolveallsortsofproblems,theywerenotwidelyacceptedasarigorousmathematicaltool.Inthelatterpartofthe19thcentury,theywerereplaced byincrementalchangesthattendtowardszerotoformalimitidentifyingsome desiredresult.ThiswasmainlyduetotheworkoftheGermanmathematicianKarl Weierstrass(1815–1897),andtheFrenchmathematicianAugustin-LouisCauchy (1789–1857).

Inspiteofthebasicideasofcalculusbeingrelativelyeasytounderstand,ithas areputationforbeingdifficultandintimidating.Ibelievethattheproblemliesin thebreadthanddepthofcalculus,inthatitcanbeappliedacrossawiderange ofdisciplines,fromelectronicstocosmology,wherethenotationoftenbecomes extremelyabstractwithmultipleintegrals,multi-dimensionalvectorspacesand matricesformedfrompartialdifferentialoperators.InthisbookIintroducethereader tothoseelementsofcalculusthatarebotheasytounderstandandrelevanttosolving variousmathematicalproblemsfoundincomputergraphics.

Ontheonehand,perhapsyouhavestudiedcalculusatsometime,andhavenot hadtheopportunitytouseitregularlyandbecomefamiliarwithitsways,tricksand analyticaltechniques.Inwhichcase,thisbookcouldawakensomedistantmemory andrevealasubjectwithwhichyouwereoncefamiliar.Ontheotherhand,thismight beyourfirstjourneyintotheworldoffunctions,limits,differentialsandintegrals—in whichcase,youshouldfindthejourneyexciting!

Chapter2 Functions

2.1Introduction

Inthischapterthenotionofafunctionisintroducedasatoolforgeneratingone numericalquantityfromanother.Inparticular,welookatequations,theirvariables andanypossiblesensitiveconditions.Thisleadstowardtheideaofhowfastafunction changesrelativetoitsindependentvariable.Thesecondpartofthechapterintroduces twomajoroperationsofcalculus:differentiating,anditsinverse,integrating.Thisis performedwithoutanyrigorousmathematicalunderpinning,andpermitsthereader todevelopanunderstandingofcalculuswithoutusinglimits.

2.2Expressions,Variables,ConstantsandEquations

Oneofthefirstthingswelearninmathematicsistheconstructionof expressions,such as2( x + 5) 2,using variables, constants andarithmetic operators.Thenextstep istodevelopanequation,whichisamathematicalstatement,insymbols,declaring thattwothingsareexactlythesame(orequivalent).Forexample,(2.1)istheequation representingthesurfaceareaofasphere

where S and r arevariables.Theyarevariablesbecausetheytakeondifferentvalues, dependingonthesizeofthesphere. S dependsuponthechangingvalueof r ,andto distinguishbetweenthetwo, S iscalledthe dependentvariable,and r the independent variable.Similarly,(2.2)istheequationforthevolumeofatorus

©SpringerNatureSwitzerlandAG2023

J.Vince, CalculusforComputerGraphics, https://doi.org/10.1007/978-3-031-28117-4_2

wherethe dependentvariableV dependsonthetorus’sminorradius r andmajor radius R ,whichareboth independentvariables.Notethatbothformulaeinclude constants4, π and2.Therearenorestrictionsonthenumberofvariablesorconstants employedwithinanequation.

2.3Functions

Theconceptofafunctionisthatofa dependentrelationship.Someequationsmerely expressanequality,suchas19 = 15 + 4,butafunctionisaspecialtypeofequationinwhichthevalueofonevariable(thedependentvariable)dependson,andis determinedby,thevaluesofoneormoreothervariables(theindependentvariables). Thus,intheequation

onemightsaythat S isafunctionof r ,andintheequation

V isafunctionof r and R . Itisusualtowritetheindependentvariables,separatedbycommas,inbrackets immediatelyafterthesymbolforthedependentvariable,andsothetwoequations aboveareusuallywritten

and

Theorderoftheindependentvariablesisimmaterial.

Mathematically,thereisnodifferencebetweenequationsandfunctions,itissimplyaquestionofnotation.However,whenwedonothaveanequation,wecanusethe ideaofafunctiontohelpusdevelopone.Forexample,noonehasbeenabletofind anequationthatgeneratesthe n thprimenumber,butIcandeclareafunction P (n ) thatpretendstoperformthisoperation,suchthat P (1) = 2, P (2) = 3, P (3) = 5, etc.Atleastthisimaginaryfunction P (n ),permitsmetomoveforwardandreflect uponitspossibleinnerstructure.

Amathematicalfunction must haveaprecisedefinition.It must bepredictable, andideally,workunderallconditions.

Weareallfamiliarwithmathematicalfunctionssuchassin x ,cos x ,tan x , √ x , etc.,where x istheindependentvariable.Suchfunctionspermitustoconfidently

writestatementssuchas

withoutworryingwhethertheywillalwaysprovideacorrectanswer.

Weoftenneedtodesignafunctiontoperformaspecifictask.Forinstance,ifI requireafunction y ( x ) tocompute x 2 + x + 6,theindependentvariableis x andthe functioniswritten

suchthat

2.3.1ContinuousandDiscontinuousFunctions

Understandably,afunction’svalueissensitivetoitsindependentvariables.A simple square-rootfunction,forinstance,expectsapositiverealnumberasitsindependent variable,andregistersanerrorconditionforanegativevalue.Ontheotherhand,a usefulsquare-rootfunctionwouldacceptpositiveandnegativenumbers,andoutput arealresultforapositiveinputandacomplexresultforanegativeinput.

Anotherdangerconditionisthepossibilityofdividingbyzero,whichisnot permissibleinmathematics.Forexample,thefollowingfunction y ( x ) isundefined for x = 1,andcannotbedisplayedonthegraphshowninFig. 2.1

whichiswhymathematiciansincludeadomainofdefinitioninthespecificationof afunction

Fig.2.1 Graphof y = ( x 2 + 1)/( x 1) showingthediscontinuityat x = 1

( x ) = x 2 + 1 x 1 for x = 1

Wecancreateequationsorfunctionsthatleadtoallsortsofmathematicalanomalies.Forexample,(2.3)createsthecondition0/0when x = 4

Similarly,mathematicianswouldwrite(2.3)as

Suchconditionshavenonumericalvalue.However,thisdoesnotmeanthatthese functionsareunsound—theyarejustsensitivetospecificvaluesoftheirindependent variable.Fortunately,thereisawayofinterpretingtheseresults,aswewilldiscover inthenextchapter.

2.3.2LinearGraphFunctions

Lineargraphfunctions areprobablythesimplestfunctionswewilleverencounter andarebaseduponequationsoftheform

Fig.2.2 Graphof y = 0.5 x + 2

Fig.2.3 Graphof y = 5sin x y = mx + c .

Forexample,thefunction y ( x ) = 0.5 x + 2isshownasagraphinFig. 2.2,where 0.5istheslope,and2istheinterceptwiththe y -axis.

2.3.3PeriodicFunctions

Periodicfunctions arealsorelativelysimpleandemploythetrigonometricfunctions sin,cosandtan.Forexample,thefunction y ( x ) = 5sin x isshownovertherange 4π< x < 4π asagraphinFig. 2.3,wherethe5istheamplitudeofthesinewave, and x istheangleinradians.

Fig.2.4 Graphof f ( x ) = 4 x 4 5 x 3 8 x 2 + 6 x 12

2.3.4PolynomialFunctions

Polynomialfunctions taketheform f ( x ) = an x n + an 1 x n 1 + an 2 x n 2 +···+ a2 x 2 + a1 x + a0

where n takesonsomevalue,and an areassortedconstants.Forexample,thefunction f ( x ) = 4 x 4 5 x 3 8 x 2 + 6 x 12isshowninFig. 2.4.

2.3.5FunctionofaFunction

Inmathematicsweoftencombinefunctionstodescribesomerelationshipsuccinctly. Forexample,thetrigonometricfunction f ( x ) = sin (2 x + 1)

isa functionofafunction.Herewehave2 x + 1,whichcanbeexpressedasthe function u ( x ) = 2 x + 1 andtheoriginalfunctionbecomes f (u ( x )) = sin (u ( x )).

Wecanincreasethedepthoffunctionstoanylimit,andinthenextchapterwe considerhowsuchdescriptionsareuntangledandanalysedincalculus.

2.3.6OtherFunctions

Youareprobablyfamiliarwithotherfunctionssuchasexponential,logarithmic, complex,vector,recursive,etc.,whichcanbecombinedtogethertoencodesimple equationssuchas

orsomethingmoredifficultsuchas

2.4AFunction’sRateofChange

Mathematiciansareparticularlyinterestedintherateatwhichafunctionchanges relativetoitsindependentvariable.Evenyouwouldbeinterestedinthischaracteristic inthecontextofyoursalaryorpensionannuity.Forexample,Iwouldliketoknow ifmypensionfundisgrowinglinearlywithtime;whetherthereissomesustained increasinggrowthrate;ormoreimportantly,ifthefundisdecreasing!Thisiswhat calculusisabout—itenablesustocalculatehowafunction’svaluechanges,relative toitsindependentvariable.

Thereasonwhycalculusappearsdaunting,isthatthereissuchawiderange offunctionstoconsider:linear,periodic,complex,polynomial,imaginary,rational, exponential,logarithmic,vector,etc.However,wemustnotbeintimidatedbysuch awidespectrum,asthemajorityoffunctionsemployedincomputergraphicsare relativelysimple,andthereareplentyoftextsthatshowhowspecificfunctionsare tackled.

2.4.1SlopeofaFunction

Inthelinearequation

y = mx + c

theindependentvariableis x ,but y isalsoinfluencedbytheconstant c ,which determinestheinterceptwiththe y -axis,and m ,whichdeterminesthegraph’sslope.

Fig.2.5 Graphof y = mx + 2fordifferentvaluesof m

3 y = -2x + 1 y = 0.5x2-2x + 1 y = 0.5x2

Fig.2.6 Graphof y = 0 5 x 2 2 x + 1showingitstwocomponents

Figure 2.5 showsthisequationwith4differentvaluesof m .Foranyvalueof x ,the slopealwaysequals m ,whichiswhatlinearmeans.

Inthequadraticequation

y = ax 2 + bx + c

y isdependenton x ,butinamuchmoresubtleway.Itisacombinationoftwo components:asquarelawcomponent ax 2 ,andalinearcomponent bx + c .Figure 2.6 showsthesetwocomponentsandtheirsumfortheequation y = 0 5 x 2 2 x + 1. Foranyvalueof x ,theslopeisdifferent.Figure 2.7 identifiesthreeslopesonthe graph.Forexample,when x = 2, y =−1,andtheslopeiszero.When x = 4, y = 1,

1

3 slope = slope2 = -2 slope=0

Fig.2.7 Graphof y = 0 5 x 2 2 x + 1showingthreegradients -3-2-10123456

Fig.2.8 Linearrelationshipbetweenslopeand x andtheslopelooksasthoughitequals2.Andwhen x = 0, y = 1,theslopelooks asthoughitequals 2.

Eventhoughwehaveonlythreesamples,let’splotthegraphoftherelationship between x andtheslope m ,asshowninFig. 2.8.Assumingthatothervaluesofslope lieonthesamestraightline,thentheequationrelatingtheslope m to x is

m = x 2.

Summarising:wehavediscoveredthattheslopeofthefunction

f ( x ) = 0 5 x 2 2 x + 1

changeswiththeindependentvariable x ,andisgivenbythefunction

f ( x ) = x 2.

Notethat f ( x ) istheoriginalfunction,and f ( x ) (pronounced fprime of x )isthe functionfortheslope,whichisaconventionoftenusedincalculus.

Rememberthatwehavetakenonlythreesampleslopes,andassumedthatthere isalinearrelationshipbetweentheslopeand x .Ideally,weshouldhavesampledthe graphatmanymorepointstoincreaseourconfidence,butIhappentoknowthatwe areonsolidground!

Calculusenablesustocomputethefunctionfortheslopefromtheoriginalfunction.i.e.tocompute f ( x ) from f ( x )

Readerswhoarealreadyfamiliarwithcalculuswillknowhowtocompute(2.6)from (2.5),butforotherreaders,thisisthetechnique:

1.Takeeachtermof(2.5)inturnandreplace ax n by nax n 1

2.Therefore0.5 x 2 becomes x .

3. 2 x ,whichcanbewritten 2 x 1 ,becomes 2 x 0 ,whichis 2. 4.1isignored,asitisaconstant.

5.Collectingupthetermswehave f ( x ) = x 2.

Thisprocessiscalled differentiating afunction,andiseasyforthistypeofpolynomial.Soeasyinfact,wecandifferentiatethefollowingfunctionwithoutthinking

Thisisanamazingrelationship,andisoneofthereasonswhycalculusissoimportant. Ifwecandifferentiateapolynomialfunction,surelywecanreversetheoperation andcomputetheoriginalfunction?Wellofcourse!Forexample,if f ( x ) isgivenby f ( x ) = 6 x 2 + 4 x + 6(2.7)

thenthisisthetechniquetocomputetheoriginalfunction:

1.Takeeachtermof(2.7)inturnandreplace ax n by 1 n +1 ax n +1 .

2.Therefore6 x 2 becomes2 x 3 .

3.4 x becomes2 x 2 . 4.6becomes6 x

Fig.2.9 Asinecurveovertherange0◦ to360◦

5.Introduceaconstant C whichmighthavebeenpresentintheoriginalfunction. 6.Collectingupthetermswehave

Thisprocessiscalled integrating afunction.Thuscalculusisaboutdifferentiating andintegratingfunctions,whichsoundsrathereasy,andinsomecasesitistrue.The problemisthebreadthoffunctionsthatariseinmathematics,physics,geometry, cosmology,science,etc.Forexample,howdowedifferentiateorintegrate

f ( x ) = sin x + x cosh x cos2 x ln x 3 ?

Personally,Idon’tknow,buthopefully,thereisasolutionsomewhere.

2.4.2DifferentiatingPeriodicFunctions

Nowlet’strydifferentiatingthesinefunctionbysamplingitsslopeatdifferentpoints. Figure 2.9 showsasinecurveovertherange0◦ to360◦ .Strictlyspeakingweshould beusingradians,whichimpliesthattherangeis0to2π .However,whenthescales fortheverticalandhorizontalaxesareequal,theslopeis1at0◦ and360◦ .Theslope iszeroat90◦ and270◦ ,and 1at180◦ .Figure 2.10 plotstheseslopevaluesagainst x andconnectsthemwithstraightlines. ItshouldbeclearfromFig. 2.9 thattheslopeofthesinewavedoesnotchange linearlyasshowninFig. 2.10.Theslopestartsat1,andforthefirst20◦ ,orso,slowly fallsaway,andthencollapsestozero,asshowninFig. 2.11,whichisacosinewave

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Instant ebooks textbook Calculus for computer graphics, 3rd edition john vince download all chapters by Education Libraries - Issuu