using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace CircleTest
{
/// <summary>
/// 因为vector2的精度不高,封装了一个double类型的坐标类
/// </summary>
public class MyVector2
{
public double x;
public double y;
public MyVector2(Vector2 a)
{
x = a.x;
y = a.y;
}
public MyVector2(double a, double b)
{
x = a;
y = b;
}
public MyVector2()
{
}
public Vector2 Vec2
{
get
{
return new Vector2((float)x, (float)y);
}
}
public override string ToString()
{
return string.Format("({0},{1})", x.ToString("f3"), y.ToString("f3"));
}
public static MyVector2 operator +(MyVector2 b, MyVector2 c)
{
MyVector2 box = new MyVector2();
box.x = b.x + c.x;
box.y = b.y + c
Unity C# 根据两个点和半径求圆心,并画出这段圆弧
最新推荐文章于 2024-01-06 13:33:45 发布