■ 외적(Cross Product) 구하기

------------------------------------------------------------------------------------------------------------------------

#region 외적 구하기 - GetCrossProduct(aX, aY, bX, bY, cX, cY)

 

/// <summary>

/// 외적 구하기

/// </summary>

/// <param name="aX">A X 좌표</param>

/// <param name="aY">A Y 좌표</param>

/// <param name="bX">B X 좌표</param>

/// <param name="bY">B Y 좌표</param>

/// <param name="cX">C X 좌표</param>

/// <param name="cY">C Y 좌표</param>

/// <returns>외적</returns>

/// <remarks>AB×BC 외적을 구합니다.</remarks>

public float GetCrossProduct(float aX, float aY, float bX, float bY, float cX, float cY)

{

    float abX = aX - bX;

    float abY = aY - bY;

    float cbX = cX - bX;

    float cbY = cY - bY;

 

    return (abX * cbY - abY * cbX);

}

 

#endregion

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요