mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
1. Workben项目中,优化了Node的入参类型与返回类型包含泛型成员的类型显示。
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
|
||||
namespace Serein.Workbench.Extension
|
||||
{
|
||||
@@ -44,34 +39,4 @@ namespace Serein.Workbench.Extension
|
||||
return new Vector(me.X, me.Y);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向量(Vector)的扩展方法
|
||||
/// </summary>
|
||||
public static class VectorExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算两个向量的点积。
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <param name="b"></param>
|
||||
/// <returns></returns>
|
||||
public static double DotProduct(this Vector a, Vector b)
|
||||
{
|
||||
return a.X * b.X + a.Y * b.Y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算两个向量的叉积。
|
||||
/// </summary>
|
||||
/// <param name="v"></param>
|
||||
/// <returns></returns>
|
||||
public static Vector NormalizeTo(this Vector v)
|
||||
{
|
||||
var temp = v;
|
||||
temp.Normalize();
|
||||
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Workbench/Extension/VectorExtension.cs
Normal file
40
Workbench/Extension/VectorExtension.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace Serein.Workbench.Extension
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 向量(Vector)的扩展方法
|
||||
/// </summary>
|
||||
public static class VectorExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算两个向量的点积。
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <param name="b"></param>
|
||||
/// <returns></returns>
|
||||
public static double DotProduct(this Vector a, Vector b)
|
||||
{
|
||||
return a.X * b.X + a.Y * b.Y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算两个向量的叉积。
|
||||
/// </summary>
|
||||
/// <param name="v"></param>
|
||||
/// <returns></returns>
|
||||
public static Vector NormalizeTo(this Vector v)
|
||||
{
|
||||
var temp = v;
|
||||
temp.Normalize();
|
||||
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user