Here are two videos on the reference site: how is the differentiation in game mathematics different from math?
Regarding 8:22
of the Unity engine video, I would like to know the following:
I looked at how to solve the differential in the video of the try, but I don't understand the meaning of the func(float x)
function. Why do I need a function that takes the square of X?
Also, I would like to know the difference between the use of differential in game mathematics and mathematics.
I looked up how to solve differentials online.
Differential inclination - learn the math used to create games #8 (YouTube) (Unity Engine Video)
数学Math II 第Chapter 6 章Differentiation and Integration Complete (YouTube) (Video of Tri)
Refer to differentiation method ([Differentiation method] derivative formula)
using System;
public static class program
{
static float func (float x)
{
return x*x;
}
static float derivative (float x)
{
const flow = 0.1;
return(func(x+h)-func(x))/h;
}
public static void Main()
{
Console.WriteLine (derivative (3.0));
}
}
There is no particular difference between mathematics and ordinary mathematics in making games.You may want to approximate continuously changing values on your computer.
Consider a function f that returns a real number when given a real number x.As described in various explanations, the function f' obtained by differentiating this function f by x can be defined by the following formula:
Now, mathematically, the definition of differentiation requires a limit, but if you want to program this definition, you have to calculate the limit somewhere in the program.
We can't do that in a common programming language, so we'll try to approximate it in a different way.In the video that the questioner referred to this time, the differential value is approximated by using a very small value as h
and calculating the fraction on the right.Actually, I want to know the limit when h
is close to 0
, but I can't do that, so I'm replacing it with a value as close to 0
.
Now, we are choosing f(x)=x2 as an example to confirm the approximation of this differential, probably because it is easy to understand.This method can be used for more functions in the same way, so you don't have to stick to f(x)=x2.
581 PHP ssh2_scp_send fails to send files as intended
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.