Skip to content

Instantly share code, notes, and snippets.

@Kryzarel
Kryzarel / EasingFunctions.cs
Last active May 23, 2024 14:50
C# Easing Functions
using System;
namespace Kryz.Tweening
{
// Made with the help of this great post: https://joshondesign.com/2013/03/01/improvedEasingEquations
// --------------------------------- Other Related Links --------------------------------------------------------------------
// Original equations, bad formulation: https://github.com/danro/jquery-easing/blob/master/jquery.easing.js
// A few equations, very simplified: https://gist.github.com/gre/1650294
// Easings.net equations, simplified: https://github.com/ai/easings.net/blob/master/src/easings/easingsFunctions.ts
@ditzel
ditzel / MathParabola.cs
Last active February 19, 2024 02:07
A simple Math class to calculate a point in 2D or 3D space lying on a parabola. And a more complex parabola controller that you can put on an object.
using UnityEngine;
using System;
public class MathParabola
{
public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t)
{
Func<float, float> f = x => -4 * height * x * x + 4 * height * x;
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 31, 2024 12:55
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights