I want to know the difference between game math and math in differentiation.

Asked 1 years ago, Updated 1 years ago, 315 views

Question details

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:

What do you want to know

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.

What I checked

I looked up how to solve differentials online.

Reference Site

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));
    }
}

c# mathematics

2022-12-28 04:56

1 Answers

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:

f'(x)=lim_{h→0}(f(x+h)-f(x)/h

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.


2022-12-28 09:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.