Perpendicular#
Math / Perpendicular
Can Read
Cannot Write
Description#
Returns a direction vector perpendicular to a given vector
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Perpendicular")]
[Category("Math/Perpendicular")]
[Description("Returns a direction vector perpendicular to a given vector")]
[Image(typeof(IconAngleRight), ColorTheme.Type.Yellow)]
[Keywords("Vector", "Orthogonal", "Right", "90")]
[Serializable]
public class TypeVector2MathPerpendicular : TypeVector2
{
[SerializeField] private GetVector2 m_Direction = new GetVector2();
public override Vector2 GetPreview(GameObject source) => Vector2.Perpendicular(this.m_Direction.GetPreview(source));
public override Vector2 Get(Args args)
{
return Vector2.Perpendicular(this.m_Direction.Get(args));
}
public override string ToString()
{
return $"Perpendicular of {this.m_Direction}";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}