{"product_id":"140022","title":"Nature of Code (JavaScript Edition) ","description":"\u003ccenter\u003e\u003cdiv style=\"text-align:center\"\u003e\u003cimg src=\"https:\/\/tmgdisk01.cafe24.com\/images\/vs\/4172\/sv\/3jYGWrzz0U0yYNk46eQpHOW9XfsYBT.png?v=1765077842\" style=\"max-width:100%;max-height:10px\"\u003e\u003c\/div\u003e\u003c\/center\u003e\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\u003ccenter\u003e\n\n\u003cdiv style=\"width:95%\"\u003e\n\n\u003cdiv style=\"text-align:center;font-size:30px;font-weight:bolder;line-height:1.6em\"\u003e Nature of Code (JavaScript Edition) \u003c\/div\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cdiv style=\"border-bottom:1px;border-bottom-style:dotted;border-color:;padding-bottom:20px\"\u003e\u003ccenter\u003e\u003ctable align=\"center\" width=\"100%\"\u003e\u003ctbody style=\"border:0px\"\u003e\n\n\u003ctr\u003e\u003ctd align=\"center\" style=\"line-height:1.2em;text-align:center;font-size:18px;color:black;font-weight:bold;padding-bottom:20px;\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\n\n\u003ctr\u003e\u003ctd style=\"text-align:center\"\u003e\u003cimg src=\"https:\/\/image.yes24.com\/goods\/148477424\/XL\" style=\"max-width:100%;height:auto\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\n\n\n\u003c\/tbody\u003e\u003c\/table\u003e\u003c\/center\u003e\u003c\/div\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cdiv style=\"width:95%;{split_style6}padding-top:20px;padding-bottom:20px\"\u003e\n\n\u003cdiv style=\"text-align:left;font-size:16px;font-weight:bold;padding-bottom:20px\"\u003e Description \u003c\/div\u003e\n\n\u003cdiv style=\"text-align:left;word-break:break-all;font-size:14px;line-height:1.6em;\"\u003e\n\n\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eBook Introduction\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\u003cdiv\u003e \u003cb\u003eUnravel the mysteries of nature while learning to code with JavaScript.\u003c\/b\u003e\u003cbr\u003e\u003cbr\u003e A revised JavaScript edition of 『Nature of Code』, which has inspired countless readers for over a decade.\u003cbr\u003e Written by Daniel Shiffman of the \"Coding Train\" channel, this groundbreaking guide introduces both beginners and experienced programmers to the world where code meets playful creativity.\u003cbr\u003e It gently unravels the mysteries of nature, such as vectors, Newton's laws of motion, and vibration, and even explores complex topics like evolution, genetic algorithms, neural networks, and machine learning.\u003cbr\u003e You can experience the amazing pleasure of implementing your own physics engine and turning code into art.\u003cbr\u003e\n\n\u003c\/div\u003e\u003c\/div\u003e\n\u003cdiv\u003e\u003cul\u003e\u003cli\u003e You can preview some of the book's contents.\u003cbr\u003e \u003cspan\u003ePreview\u003c\/span\u003e\n\n\u003c\/li\u003e\u003c\/ul\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eindex\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e About the Author, Reviewer, and Translator xii \u003cbr\u003eTranslator's Preface xiii\u003cbr\u003e Beta Reader Review xiv\u003cbr\u003e Recommendation xvi\u003cbr\u003e Acknowledgments xviii\u003cbr\u003e About this book xxiv\u003cbr\u003e\u003cbr\u003e CHAPTER 0 Randomness 1\u003cbr\u003e 0.1 Random Walk 2\u003cbr\u003e 0.2 Random Walker Class 3\u003cbr\u003e 0.3 Probability and Nonuniform Distribution 10\u003cbr\u003e 0.4 Normal distribution of random numbers 14\u003cbr\u003e 0.5 Custom distribution of random numbers 18\u003cbr\u003e A softer approach using 0.6 Perlin noise 21\u003cbr\u003e\u003cbr\u003e CHAPTER 1 Vectors 33\u003cbr\u003e 1.1 The Importance of Vectors 34\u003cbr\u003e 1.2 Vectors in p5.js 37\u003cbr\u003e 1.3 Vector Addition 40\u003cbr\u003e 1.4 Additional Vector Mathematics 45\u003cbr\u003e 1.5 Length of vector 50\u003cbr\u003e 1.6 Vector Normalization 52\u003cbr\u003e 1.7 Movement Using Vectors 54\u003cbr\u003e 1.8 Acceleration 59\u003cbr\u003e\u003cbr\u003e CHAPTER 2: FORCE 71\u003cbr\u003e 2.1 Forces and Newton's Laws of Motion 72\u003cbr\u003e 2.2 Accumulation of Force 78\u003cbr\u003e 2.3 Considering Mass 80\u003cbr\u003e 2.4 Building Power 82\u003cbr\u003e 2.5 Modeling Forces 88\u003cbr\u003e 2.6 n-body problem 110\u003cbr\u003e\u003cbr\u003e CHAPTER 3: VIBRATION 117\u003cbr\u003e 3.1 Angle 118\u003cbr\u003e 3.2 Each movement 120\u003cbr\u003e 3.3 Trigonometric Functions 126\u003cbr\u003e 3.4 Direction of Movement 127\u003cbr\u003e 3.5 Polar and Cartesian Coordinates 131\u003cbr\u003e 3.6 Vibration Characteristics 134\u003cbr\u003e 3.7 Vibration using angular velocity 138\u003cbr\u003e 3.8 Wave 142\u003cbr\u003e 3.9 Spring force 147\u003cbr\u003e 3.10 Pendulum 154\u003cbr\u003e \u003cbr\u003eCHAPTER 4 Particle Systems 165\u003cbr\u003e 4.1 The Importance of Particle Systems 166\u003cbr\u003e 4.2 Single Particle 168\u003cbr\u003e 4.3 Particle Array 172\u003cbr\u003e 4.4 Particle Emitter 178\u003cbr\u003e 4.5 Emitter System 181\u003cbr\u003e 4.6 Inheritance and Polymorphism 184\u003cbr\u003e 4.7 Particle Systems Using Forces 197\u003cbr\u003e 4.8 Particle system applying the force of the pushing object 200\u003cbr\u003e 4.9 Image Textures and Additive Blending 205\u003cbr\u003e\u003cbr\u003e CHAPTER 5 Autonomous Agents 213\u003cbr\u003e 5.1 The Power of Choosing by One's Own Will 214\u003cbr\u003e 5.2 Vehicles and Steering 215\u003cbr\u003e 5.3 Flow field 232\u003cbr\u003e 5.4 Following the Path 239\u003cbr\u003e 5.5 Complex Systems 256\u003cbr\u003e 5.6 Algorithmic Efficiency: Why Is My Program So Slow? 273\u003cbr\u003e\u003cbr\u003e CHAPTER 6 Physics Library 285\u003cbr\u003e 6.1 Why Use a Physics Library? 287\u003cbr\u003e 6.2 Importing the Matter.js Library 289\u003cbr\u003e 6.3 Matter.js Overview 291\u003cbr\u003e 6.4 Matter.js with p5.js 301\u003cbr\u003e 6.5 Static Matter.js Body 306\u003cbr\u003e 6.6 Polygons and Shape Groups 307\u003cbr\u003e 6.7 Matter.js Constraints 315\u003cbr\u003e 6.8 Applying Various Forces 323\u003cbr\u003e 6.9 Crash Event 327\u003cbr\u003e 6.10 A Brief Introduction: Integral Calculus 331 \u003cbr\u003e6.11 Berle Physics 333 with Toxiclibs.js\u003cbr\u003e 6.12 Delinquency Simulation 342\u003cbr\u003e 6.13 Gravitational and Repulsive Forces 355\u003cbr\u003e\u003cbr\u003e CHAPTER 7 Cellular Automata 359\u003cbr\u003e 7.1 What are cellular automata? 360\u003cbr\u003e 7.2 Basic Cellular Automata 362\u003cbr\u003e 7.3 Wolfram's Classification System 380\u003cbr\u003e 7.4 Game of Life 382\u003cbr\u003e 7.5 Creating Object-Oriented Cells 391\u003cbr\u003e 7.6 Variations on Traditional Cellular Automata 394\u003cbr\u003e\u003cbr\u003e CHAPTER 8 Fractals 399\u003cbr\u003e 8.1 What is a Fractal? 400\u003cbr\u003e 8.2 Recursion 403\u003cbr\u003e 8.3 Coke Curve 414\u003cbr\u003e 8.4 Tree 422\u003cbr\u003e 8.5 L-System 430\u003cbr\u003e\u003cbr\u003e CHAPTER 9 Evolutionary Computing 439\u003cbr\u003e 9.1 Genetic Algorithms: The Wisdom of Nature 440\u003cbr\u003e 9.2 Why Use Genetic Algorithms? 441\u003cbr\u003e 9.3 How Genetic Algorithms Work 444\u003cbr\u003e 9.4 Coding Genetic Algorithms 452\u003cbr\u003e 9.5 Customizing the Genetic Algorithm 464\u003cbr\u003e 9.6 Evolving Power: Smart Rocket 471\u003cbr\u003e 9.7 Interactive Selection 484\u003cbr\u003e 9.8 Ecosystem Simulation 489\u003cbr\u003e\u003cbr\u003e CHAPTER 10: NEURAL NETWORKS 499\u003cbr\u003e 10.1 Introduction to Artificial Neural Networks 501\u003cbr\u003e 10.2 Perceptron 505\u003cbr\u003e 10.3 Adding a 'Network' to a Neural Network 521\u003cbr\u003e 10.4 Machine Learning with ml5.js 524 \u003cbr\u003e10.5 Building a Gesture Classifier 532\u003cbr\u003e\u003cbr\u003e CHAPTER 11: NEUROEVOLUTION 545\u003cbr\u003e 11.1 Reinforcement Learning 547\u003cbr\u003e 11.2 Evolution of Neural Networks: The NEAT Algorithm 552\u003cbr\u003e 11.3 Coding Flappy Bird 553\u003cbr\u003e 11.4 Neuro-Evolving Flappy Bird 557\u003cbr\u003e 11.5 Steering with Neuroevolution 568\u003cbr\u003e 11.6 Neuroevolutionary Ecosystems 576\u003cbr\u003e\u003cbr\u003e Conclusion 587\u003cbr\u003e Appendix: Lifeform Design 589\u003cbr\u003e Source of the illustration 593\u003cbr\u003e Search 596\u003c\/div\u003e\n\u003cdiv\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eDetailed image\u003c\/b\u003e \u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\u003cdiv\u003e\u003cimg src=\"https:\/\/image.yes24.com\/momo\/TopCate5407\/MidCate005\/540642798.jpg\" border=\"0\" alt=\"Detailed Image 1\"\u003e\u003c\/div\u003e\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eInto the book\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e It's Saturday morning.\u003cbr\u003e After a refreshing jog, a delicious bowl of cereal, and a quiet moment at the computer with a cup of warm chamomile tea, I went for a walk.\u003cbr\u003e Looking at the calendar, I saw that it was soon to be an old friend's birthday, so I decided to make a congratulatory card with p5.js. \u003cbr\u003eHow about a greeting card with flying confetti? I decided to create a greeting card where confetti of various shapes and movements explodes on the screen at once: purple, pink, star-shaped, square, fast-flying, slow-falling.\u003cbr\u003e \/ This is a particle system.\u003cbr\u003e This is a particle system that handles particles called confetti.\u003cbr\u003e We can redesign the Particle class to include variables that store color, shape, movement, etc.\u003cbr\u003e\u003cbr\u003e --- p.185\u003cbr\u003e\u003cbr\u003e All Flappy Bird games made so far have been controlled by clicking the mouse.\u003cbr\u003e Now, let's make computers play games themselves and teach them how to do so through neuroevolution.\u003cbr\u003e ml5.js has built-in neural evolution functionality, making it relatively easy to implement. \u003cbr\u003eThe first step is to implant a 'brain' in the bird so that it can decide for itself whether to flap its wings or not.\u003cbr\u003e\u003cbr\u003e --- p.557\u003cbr\u003e\u003cbr\u003e A good random number generator produces numbers that are unrelated and show no apparent pattern.\u003cbr\u003e However, when programming natural, lifelike movements, a little randomness is enough.\u003cbr\u003e Rather, completely uniform randomness can be unnatural.\u003cbr\u003e The Perlin noise algorithm, created by Ken Perlin, was created with these aspects in mind.\u003cbr\u003e This algorithm ensures that consecutive numbers have similar values.\u003cbr\u003e This smooths out the transitions between numbers, giving them a more natural feel than if they were completely random.\u003cbr\u003e That's why Perlin noise is often used to create natural patterns such as clouds, landscapes, and marble patterns.\u003cbr\u003e\u003cbr\u003e --- p.21\u003cbr\u003e \u003cbr\u003eThe following diagram provides ideas that may be helpful when creating an ecosystem based on the contents of this book.\u003cbr\u003e Watch how this picture evolves as you learn new concepts and techniques.\u003cbr\u003e \/ Since the main purpose of this book is to demonstrate algorithms and behavioral principles, most of the examples consist of simple shapes such as circles.\u003cbr\u003e But you may have more creative ideas than this.\u003cbr\u003e So, challenge yourself to design with the elements you draw.\u003cbr\u003e If you're new to translating your designs into code, check out this guide by Jana Marsh, the book's illustrator.\u003cbr\u003e This guide in the appendix teaches you how to draw with code.\u003cbr\u003e\u003cbr\u003e --- p.32\u003cbr\u003e\u003cbr\u003e Let's take another look at the code for the attract() method. \u003cbr\u003eDo you see the division sign? Every time you perform a division operation, you should ask yourself, \"What happens if the distance is very small, or (even worse!) zero?\"\u003cbr\u003e Dividing by zero is impossible, and dividing by a very small number like 0.0001 is essentially the same as multiplying by 10,000! This might not be a problem in the real-world gravity formula, but p5.js isn't the real world.\u003cbr\u003e In p5.js, the mover can get too close to the attractor, and the force can become so strong that the mover flies off the screen.\u003cbr\u003e \/ Conversely, let's assume the mover is 500 pixels away from the attractor.\u003cbr\u003e Since we square the distance, this is equivalent to dividing the force by 250,000.\u003cbr\u003e Then the force may be so weak that it may seem almost ineffective.\u003cbr\u003e\u003cbr\u003e --- p.106\u003cbr\u003e\u003cbr\u003e Not as interesting as the Sierpinski triangle. \u003cbr\u003eAs mentioned earlier, most of the 256 basic rule sets don't produce very nice patterns.\u003cbr\u003e But it's truly fascinating that even simple cells with just two states can create the amazing patterns we see in nature.\u003cbr\u003e For example, the snail shell in Figure 7.18 has a shape similar to the pattern created by Wolfram's Rule 30.\u003cbr\u003e This shows how useful cellular automata are for mimicking natural patterns and creating new ones.\u003cbr\u003e \/ So before we dive into the details of what different sets of rules produce, let's learn how to create and display a basic Wolfram cellular automata using p5.js.\u003cbr\u003e\n\n\u003c\/div\u003e\n\u003cdiv\u003e --- p.369\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cdiv\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003ePublisher's Review\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e \u003cb\u003eA special adventure with Daniel Shipman, the world's funniest coding YouTuber.\u003c\/b\u003e\u003cbr\u003e \u003cbr\u003eWhat if you could recreate the awe-inspiring flocks of birds or the hypnotic dance of fireflies with code? \"The Nature of Code,\" written by Daniel Schiffman of the popular YouTube channel \"Coding Train,\" has transformed countless readers into creators, breaking down the barriers between science, art, and technology and encouraging them to view code not simply as a tool, but as a canvas for limitless creativity.\u003cbr\u003e The recently published 『Nature of Code (JavaScript Edition)』 is the latest revised edition that changes the example code language from Processing to JavaScript (p5.js) and adds additional content.\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e Starting with the concept of vectors, we'll explore Newton's laws of motion, oscillations, and trigonometry to create our own simple physics engine in JavaScript. \u003cbr\u003eBased on this, we simulate complex systems, steering, and flocking, and further explain complex topics such as evolution and genetic algorithms, neural networks, machine learning, and neuroevolutionary systems in an easy-to-understand manner.\u003cbr\u003e The process of transforming common natural phenomena into visually stunning works of art using object-oriented programming is truly thrilling.\u003cbr\u003e All of the book's example code is available for testing directly on the book's official website.\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e Everyone, get on board the 'Coding Train' and embark on a special adventure of creative coding.\u003cbr\u003e You'll learn the fundamentals of coding while discovering the joy of turning code into art.\u003cbr\u003e You will see nature in a new way and be inspired by its wonders to create your own.\u003cbr\u003e Whether you're a beginner or an experienced programmer, this book will guide you into the amazing world where code and creativity intersect.\u003cbr\u003e\u003cbr\u003e \u003cbr\u003eKey Contents\u003cbr\u003e ● Physics Engine: Simulates the push and pull of gravity.\u003cbr\u003e ● Flocking: Create a captivating flock dance.\u003cbr\u003e ● Pruning Trees: Create vivid, organic branch structures.\u003cbr\u003e ● Neural Networks: Build intelligent systems that learn and adapt.\u003cbr\u003e ● Cellular Automata: Discover the magic of self-organizing patterns.\u003cbr\u003e ● Evolutionary Algorithms: Experience natural selection directly in code. \u003cbr\u003e\n\n\u003c\/div\u003e\n\u003cdiv\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cdiv style=\"width:95%;padding-top:20px;padding-bottom:20px\"\u003e\n\n\u003cdiv style=\"text-align:left;font-size:16px;font-weight:bold;padding-bottom:20px\"\u003e GOODS SPECIFICS \u003c\/div\u003e\n\n\u003cdiv style=\"text-align:left;font-size:14px;line-height:1.6em;\"\u003e\n\n\u003cdiv style=\"width:100%;margin-bottom:5px;line-height:1.6em;font-size:14px\"\u003e - \u003cstrong\u003eDate of issue:\u003c\/strong\u003e July 22, 2025\u003c\/div\u003e\n\n\u003cdiv style=\"width:100%;margin-bottom:5px;line-height:1.6em;font-size:14px\"\u003e - \u003cstrong\u003ePage count, weight, size:\u003c\/strong\u003e 640 pages | 1,230g | 188*245*30mm\u003c\/div\u003e\n\n\u003cdiv style=\"width:100%;margin-bottom:5px;line-height:1.6em;font-size:14px\"\u003e - \u003cstrong\u003eISBN13:\u003c\/strong\u003e 9791194587316 \u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\u003ccenter\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cspan\u003e\u003c\/span\u003e\n\n\u003c\/center\u003e\n\n\n\u003c\/center\u003e","brand":"LIBRAIRIE COREENNE","offers":[{"title":"Default Title","offer_id":43893395062826,"sku":"140022","price":51.0,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0683\/2750\/5962\/files\/20f1ba7802116fee82c33b522e7635a2.jpg?v=1765400011","url":"https:\/\/librairie.coreenne.fr\/en\/products\/140022","provider":"LIBRAIRIE COREENNE","version":"1.0","type":"link"}