2点から直線とその角度の算出
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_cg_calc_line_2pointB(
DPNT_T pnt1,
DPNT_T pnt2,
ref DLINE_T line,
ref double angle
) |
Visual Basic |
---|
Public Shared Function fnFIE_cg_calc_line_2pointB (
pnt1 As DPNT_T,
pnt2 As DPNT_T,
ByRef line As DLINE_T,
ByRef angle As Double
) As Integer |
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_PARAM | 不正なパラメータが渡された |
F_ERR_CALC_IMPOSSIBLE | 計算不能エラー |
F_ERR_NO_LICENCE | ライセンスエラー、または未初期化エラー |
Remarks
Examples
C# | Copy |
---|
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;
namespace TC
{
public partial class FIE
{
[FvPluginExecute]
public void fnFIE_cg_calc_line_2pointB()
{
int status = (int)f_err.F_ERR_NONE;
DPNT_T pnt1 = new DPNT_T();
DPNT_T pnt2 = new DPNT_T();
DLINE_T line = new DLINE_T();
DLINE_T ans_line = DLINE_T.init(-0.8, 1, -10);
pnt1.x = 50;
pnt1.y = 50;
pnt2.x = 300;
pnt2.y = 250;
status = api.fnFIE_cg_calc_line_2pointA(pnt1, pnt2, ref line);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
ConsoleOut.WriteFunctionName(":\n");
Console.WriteLine("line.a {0}", line.a);
Console.WriteLine("line.b {0}", line.b);
Console.WriteLine("line.c {0}", line.c);
Console.Write(" ...");
ConsoleOut.IsTrue(line.a == ans_line.a);
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_cg_calc_line_2pointB()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim pnt1 As New DPNT_T()
Dim pnt2 As New DPNT_T()
Dim line As New DLINE_T()
Dim ans_line As DLINE_T = DLINE_T.init(-0.8, 1, -10)
pnt1.x = 50
pnt1.y = 50
pnt2.x = 300
pnt2.y = 250
status = api.fnFIE_cg_calc_line_2pointA(pnt1, pnt2, line)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
ConsoleOut.WriteFunctionName(":" & vbLf)
Console.WriteLine("line.a {0}", line.a)
Console.WriteLine("line.b {0}", line.b)
Console.WriteLine("line.c {0}", line.c)
Console.Write(" ...")
ConsoleOut.IsTrue(line.a = ans_line.a)
End Sub
End Class |
See Also