最小二乘法原理

作者:追风剑情 发布于:2017-6-15 21:33 分类:Algorithms

      最小二乘法,又称最小平方法,是一种通过最小化误差的平方和寻找数据的最佳函数匹配的方法。利用最小二乘法,可以简便地求得未知的数据,并使得这些求得的数据与实际数据之间误差的平方和为最小。当然,作为一种插值方法使用时,最小二乘法也可以用于曲线拟合。使用最小二乘法进行曲线拟合是曲线拟合中早期的一种常用方法。不过,最小二乘法理论简单,计算量小。即便在使用三次样条曲线...

阅读全文>>

标签: Algorithms

评论(0) 浏览(9961)

保存棋局状态——Zobrist Hash算法

作者:追风剑情 发布于:2017-6-11 22:20 分类:Algorithms

参考博客:http://www.cnblogs.com/IThaitian/p/3616507.html using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ZobristTest...

阅读全文>>

标签: Algorithms

评论(0) 浏览(20445)

克洛脱(Crout)矩阵分解——LU分解

作者:追风剑情 发布于:2017-6-10 13:34 分类:Algorithms

任意矩阵A都可以通过克洛脱(Crout)分解得到两个三角矩阵: 如果A是三对角矩阵(非0元素排列在三条对角线上),则克洛脱分解的结果为: 在分解后的矩阵中,,,其余各项的计算规则如下: 在得到了各个系数后,原方程组就可以分解为两个方程组,即: 对于第一个方程,求解向量yi...

阅读全文>>

标签: Algorithms

评论(0) 浏览(16359)

Mathf.Approximately()

作者:追风剑情 发布于:2017-6-9 18:45 分类:Unity3d

public static bool Approximately(float a, float b); 判断两个float型是否近似相等。 示例 using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Start(...

阅读全文>>

标签: Unity3d

评论(0) 浏览(9059)

Mathf.SmoothDamp()

作者:追风剑情 发布于:2017-6-9 18:27 分类:Unity3d

public static float SmoothDamp(float current, float target, ref float currentVelocity, float smoothTime, float maxSpeed, float deltaTime); 平滑阻尼插值 表示效果:从current位置到target位置,先加速再减速运动。 us...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5348)

Mathf.SmoothStep()

作者:追风剑情 发布于:2017-6-9 18:10 分类:Unity3d

public static float SmoothStep(float from, float to, float t); 在from与to之间平滑插值。 示例: using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { p...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5007)

DES加密解密

作者:追风剑情 发布于:2017-6-2 17:36 分类:C#

转载: http://blog.csdn.net/tammy520/article/details/23434931 public class DESCrypto { private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; ...

阅读全文>>

标签: C#

评论(0) 浏览(8577)

着色器数据类型与精度

作者:追风剑情 发布于:2017-5-27 15:29 分类:Shader

高精准度float 32位 高精度通常用于世界空间位置,纹理坐标或涉及复数函数(如三角法或幂/取幂)的标量计算。 中等精度half 16位 范围为-60000至+60000,精度约为3位十进制数 半精度对于短矢量,方向,对象空间位置,高动态范围颜色是有用的。 低精度fixed 11位 范围为-2.0至+2.0和1/256精度 固定精度对常规颜色(通常存储在常规纹理中)和...

阅读全文>>

标签: Shader

评论(0) 浏览(4682)

让Sprite支持描边

作者:追风剑情 发布于:2017-5-25 20:05 分类:Shader

参考:http://blog.csdn.net/bulademian/article/details/57082556 一、修改Sprites-Default.shader Shader "Custom/Sprite-Outline" { Properties { [PerRendererData] _MainTex ("Sprite Texture...

阅读全文>>

标签: Shader

评论(0) 浏览(12302)

ISerializationCallbackReceiver

作者:追风剑情 发布于:2017-5-24 11:54 分类:Unity3d

用来处理不能被JsonUtility序列化的类,比如Dictionary using UnityEngine; using System; using System.Collections.Generic; /// <summary> /// 封装一个可被JsonUtility序列化&反序列化的字典类 /// </summary> [Ser...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4357)

水波效果

作者:追风剑情 发布于:2017-5-22 20:57 分类:Shader

一、创建SinWater.shader Shader "Custom/SinWater" { Properties { _MainTex ("Texture", 2D) = "white" {} //控制波动周期长度 _DistanceFactor ("Distance Factor", float) = 1.0 //控制波动速率(值越大越快) _...

阅读全文>>

标签: Shader

评论(0) 浏览(5227)

Unity Remote

作者:追风剑情 发布于:2017-5-18 11:53 分类:Unity3d

一、应用商店下载Unity Remote安装到手机 二、在Unity中设置Edit->Project Settings->Editor 三、用数据线连接电脑与手机(要开启USB调试) 三、在手机中运行Unity Remote 四、在Unity中运行游戏,此时手机与电脑会同步运行。 如果连接不上,重启下Unity试试。

阅读全文>>

评论(0) 浏览(5009)

合成精灵图集——Texture2D.PackTextures()

作者:追风剑情 发布于:2017-5-17 19:06 分类:Unity3d

[MenuItem("ZWWX/Merge Selection Sprites")] static void MergeSprites() { UnityEngine.Object[] gos = Selection.GetFiltered(typeof(Texture2D), SelectionMode.Assets); Debug.Log...

阅读全文>>

标签: Unity3d

评论(0) 浏览(8297)

安装固态硬盘

作者:追风剑情 发布于:2017-5-16 17:53 分类:其他

一、在BIOS中开启AHCI模式 用AS SSD Benchmark软件查看是否打开了AHCI模式 二、设置4K对齐 (1)用AS SSD Benchmark软件查看是否4K对齐 (2)若没4K对齐,使用DiskGenius分区工具手动进行4K对齐(扇区数选择2048),只要首分区对齐即可。 三、接在原生SATA3.0接口下 用HD Tune Pro软件查看主板是否支持SATA...

阅读全文>>

评论(0) 浏览(3545)

动画编辑(四)——Any State

作者:追风剑情 发布于:2017-5-13 21:01 分类:Unity3d

Any State所指向的转换只要满足条件就会立即转换,而不管当前处于什么状态。 例如 只要isState2为true就会立即转到State2状态,而不管当前是处于State1还是其他任何状态。 Has Exit Time: 如果不勾上,就不会自动转到下一个状态。 Transition Duration: 这个时间...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5785)

屏幕坐标——挖空效果

作者:追风剑情 发布于:2017-5-13 14:55 分类:Shader

一、创建ScreenCutout.shader Shader "Custom/Screen Cutout" { Properties { _MainTex ("Texture", 2D) = "white" {} _ClipX0 ("Clip x0", float) = 0 _ClipY0 ("Clip y0", float) = 0 _ClipX1...

阅读全文>>

标签: Shader

评论(0) 浏览(4217)

Google Play services

作者:追风剑情 发布于:2017-5-12 17:45 分类:Android

Google Play services API Description in build.gradle Google+ com.google.android.gms:play-services-plus:10.2.4 Google Account...

阅读全文>>

标签: Android

评论(0) 浏览(4797)

Unity Attributes

作者:追风剑情 发布于:2017-5-11 19:06 分类:Unity3d

https://docs.unity3d.com/ScriptReference/HelpURLAttribute.html 给字段添加提示 -------------------------------------------------------------------------------------------- 给...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4501)

Mathf.Repeat()

作者:追风剑情 发布于:2017-5-11 14:27 分类:Unity3d

public static float Repeat(float t, float length); 此方法相当于取模(t%length) for (int i = -6; i <= 6; i++ ) Debug.Log(Mathf.Repeat(i, 3f)); 运行测试

阅读全文>>

标签: Unity3d

评论(0) 浏览(8369)

运动模糊(一)

作者:追风剑情 发布于:2017-5-9 11:47 分类:Shader

一、创建Shader Shader "Custom/MotionBlur" { Properties { _MainTex ("Texture", 2D) = "white" {} //混合图像时使用的混合系数 _BlurAmount ("Blur Amount", Float) = 1.0 } SubShader { Tags { "Ren...

阅读全文>>

标签: Shader

评论(0) 浏览(4678)

自定义Inspector(一)

作者:追风剑情 发布于:2017-5-8 14:50 分类:Unity3d

一、创建Custom.cs并把它挂在一个GameObject上 using UnityEngine; public class Custom : MonoBehaviour { } 二、创建CustomInspector.cs并放在Assets/Editor目录下 using System.Collections; using...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5163)

三次埃尔米特(Hermite)曲线插值

作者:追风剑情 发布于:2017-5-7 9:32 分类:Algorithms

三次埃尔米特(Hermite)曲线插值 已知表示一条曲线的某个函数f(t)在两点t0、t1的函数值f(t0)、f(t1)和一阶导数值f'(t0)、f'(t1),求三次多项式P(t):   使其满足: 于是可得到下列一组方程: 求解上述方程组得到三次多项式 经整理,所...

阅读全文>>

标签: Algorithms

评论(0) 浏览(7423)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号