2直線の中心を通る直線の算出
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_cg_calc_centerline_2line(
DLINE_T line1,
DLINE_T line2,
ref DLINE_T center_line
) |
Visual Basic |
---|
Public Shared Function fnFIE_cg_calc_centerline_2line (
line1 As DLINE_T,
line2 As DLINE_T,
ByRef center_line As DLINE_T
) 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_centerline_2line()
{
int status = (int)f_err.F_ERR_NONE;
DLINE_T line1 = new DLINE_T();
DLINE_T line2 = new DLINE_T();
DLINE_T center_line = new DLINE_T();
DLINE_T ans_line = DLINE_T.init(1,-0.720759220056127,-50);
line1.a = 2;
line1.b = -1;
line1.c = -100;
line2.a = 1;
line2.b = -1;
line2.c = -50;
status = api.fnFIE_cg_calc_centerline_2line(line1, line2, ref center_line);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
ConsoleOut.WriteFunctionName(":\n");
Console.WriteLine("center_line = ({0},{1},{2})", center_line.a, center_line.b, center_line.c);
Console.Write(" ...");
ConsoleOut.IsTrue(center_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_centerline_2line()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim line1 As New DLINE_T()
Dim line2 As New DLINE_T()
Dim center_line As New DLINE_T()
Dim ans_line As DLINE_T = DLINE_T.init(1, -0.720759220056127, -50)
line1.a = 2
line1.b = -1
line1.c = -100
line2.a = 1
line2.b = -1
line2.c = -50
status = api.fnFIE_cg_calc_centerline_2line(line1, line2, center_line)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
ConsoleOut.WriteFunctionName(":" & vbLf)
Console.WriteLine("center_line = ({0},{1},{2})", center_line.a, center_line.b, center_line.c)
Console.Write(" ...")
ConsoleOut.IsTrue(center_line.a = ans_line.a)
End Sub
End Class |
See Also