各成分のatan2を計算

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static int fnFIE_mat_atan2(
	FMATRIX_PTR ay,
	FMATRIX_PTR ax,
	FMATRIX_PTR ad
)
Visual Basic
Public Shared Function fnFIE_mat_atan2 ( 
	ay As FMATRIX_PTR,
	ax As FMATRIX_PTR,
	ad As FMATRIX_PTR
) As Integer

Parameters

ay
Type: fvalgcli..::..FMATRIX_PTR
入力行列(y成分)
ax
Type: fvalgcli..::..FMATRIX_PTR
入力行列(x成分)
ad
Type: fvalgcli..::..FMATRIX_PTR
出力行列

Return Value

Type: Int32
以下のエラーコードを返します。

エラーコード:
f_err内容
F_ERR_NONE正常終了
F_ERR_NOMEMORYメモリ不足エラー
F_ERR_INVALID_IMAGE画像オブジェクトの異常
F_ERR_INVALID_PARAMパラメータ異常
F_ERR_NO_LICENCEライセンスエラー、または未初期化エラー

Remarks

Examples

C# Copy imageCopy
//    $Revision: 1.1 $

using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        [FvPluginExecute]
        public void fnFIE_mat_atan2()
        {
            int status = (int)f_err.F_ERR_NONE;

            FMATRIX_PTR ax = FMATRIX_PTR.Zero;
            FMATRIX_PTR ay = FMATRIX_PTR.Zero;
            FMATRIX_PTR ad = FMATRIX_PTR.Zero;

            try
            {
                ax = api.fnFIE_mat_aalloc(2, 2);
                ay = api.fnFIE_mat_aalloc(2, 2);
                ad = api.fnFIE_mat_aalloc(2, 2);
                Assert.IsTrue(ax != FMATRIX_PTR.Zero, "エラーが発生しました。");
                Assert.IsTrue(ay != FMATRIX_PTR.Zero, "エラーが発生しました。");
                Assert.IsTrue(ad != FMATRIX_PTR.Zero, "エラーが発生しました。");

                // 値をセット
                ax[0, 0] = -1;
                ax[0, 1] = -0.5;
                ax[1, 0] = 0.5;
                ax[1, 1] = 1;

                ay[0, 0] = -1;
                ay[0, 1] = -0.5;
                ay[1, 0] = 0.5;
                ay[1, 1] = 1;

                status = api.fnFIE_mat_atan2(ax, ay, ad);

                Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "fnFIE_mat_atan2: エラーが発生しました。({0})", (f_err)status);
                Console.WriteLine("fnFIE_mat_atan2");

                for (int i = 0; i < ax.row; i++)
                {
                    for (int j = 0; j < ax.col; j++)
                    {
                        Console.WriteLine("ax[{0},{1}] = {2} , ay[{0},{1}] = {3}, ad[{0},{1}] = {4}", i, j, ax[i, j], ay[i, j], ad[i, j]);
                    }
                }
            }
            finally
            {
                // 解放.
                ax.Dispose();
                ay.Dispose();
                ad.Dispose();
            }
        }
    }
}


Visual Basic Copy imageCopy
'    $Revision: 1.1 $

Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    <FvPluginExecute> _
    Public Sub fnFIE_mat_atan2()
        Dim status As Integer = CInt(f_err.F_ERR_NONE)

        Dim ax As FMATRIX_PTR = FMATRIX_PTR.Zero
        Dim ay As FMATRIX_PTR = FMATRIX_PTR.Zero
        Dim ad As FMATRIX_PTR = FMATRIX_PTR.Zero

        Try
            ax = api.fnFIE_mat_aalloc(2, 2)
            ay = api.fnFIE_mat_aalloc(2, 2)
            ad = api.fnFIE_mat_aalloc(2, 2)
            Assert.IsTrue(ax <> FMATRIX_PTR.Zero, "エラーが発生しました。")
            Assert.IsTrue(ay <> FMATRIX_PTR.Zero, "エラーが発生しました。")
            Assert.IsTrue(ad <> FMATRIX_PTR.Zero, "エラーが発生しました。")

            ' 値をセット
            ax(0, 0) = -1
            ax(0, 1) = -0.5
            ax(1, 0) = 0.5
            ax(1, 1) = 1

            ay(0, 0) = -1
            ay(0, 1) = -0.5
            ay(1, 0) = 0.5
            ay(1, 1) = 1

            status = api.fnFIE_mat_atan2(ax, ay, ad)

            Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "fnFIE_mat_atan2: エラーが発生しました。({0})", CType(status, f_err))
            Console.WriteLine("fnFIE_mat_atan2")

            For i As Integer = 0 To ax.row - 1
                For j As Integer = 0 To ax.col - 1
                    Console.WriteLine("ax[{0},{1}] = {2} , ay[{0},{1}] = {3}, ad[{0},{1}] = {4}", i, j, ax(i, j), ay(i, j), ad(i, j))
                Next
            Next
        Finally
            ' 解放.
            ax.Dispose()
            ay.Dispose()
            ad.Dispose()
        End Try
    End Sub
End Class

See Also