Skip to main content

MathExtensions.Slerp

Declaration#

public static float Slerp(float start, float end, float amount)

Parameters#

NameDescription
startStart value
endEnd value
amountAmount (0 - 1)

Description#

Perform Spherical Lerp

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class Example : MonoBehaviour{    public void ExampleMethod()    {        float result = MathExtensions.Slerp(0, 50, 0.2f);    }}

Declaration#

public static Vector2 Slerp(Vector2 start, Vector2 end, float amount)

Parameters#

NameDescription
startStart value
endEnd value
amountAmount (0 - 1)

Description#

Perform Spherical Lerp

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class Example : MonoBehaviour{    public void ExampleMethod()    {        Vector2 result = MathExtensions.Slerp(new Vector2(0, 50), new Vector2(50, 0), 0.2f);    }}

Declaration#

public static Color Slerp(Color start, Color end, float amount)

Parameters#

NameDescription
startStart value
endEnd value
amountAmount (0 - 1)

Description#

Perform Spherical Lerp

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class Example : MonoBehaviour{    public void ExampleMethod()    {        Color result = MathExtensions.Slerp(Color.white, Color.red, 0.2f);    }}