2組の2直線の中心を通る直線の交点の算出(8点指定)
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_cg_calc_cross_8point(
DPNT_T pnt1,
DPNT_T pnt2,
DPNT_T pnt3,
DPNT_T pnt4,
DPNT_T pnt5,
DPNT_T pnt6,
DPNT_T pnt7,
DPNT_T pnt8,
ref DPNT_T cross
) |
Visual Basic |
---|
Public Shared Function fnFIE_cg_calc_cross_8point (
pnt1 As DPNT_T,
pnt2 As DPNT_T,
pnt3 As DPNT_T,
pnt4 As DPNT_T,
pnt5 As DPNT_T,
pnt6 As DPNT_T,
pnt7 As DPNT_T,
pnt8 As DPNT_T,
ByRef cross As DPNT_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_cross_8point()
{
int status = (int)f_err.F_ERR_NONE;
DPNT_T pts1 = new DPNT_T();
DPNT_T pts2 = new DPNT_T();
DPNT_T pts3 = new DPNT_T();
DPNT_T pts4 = new DPNT_T();
DPNT_T pts5 = new DPNT_T();
DPNT_T pts6 = new DPNT_T();
DPNT_T pts7 = new DPNT_T();
DPNT_T pts8 = new DPNT_T();
DPNT_T cross = new DPNT_T();
DPNT_T ans_cross = DPNT_T.init(225, 175);
pts1.x = 50;
pts1.y = 150;
pts2.x = 150;
pts2.y = 200;
pts3.x = 100;
pts3.y = 50;
pts4.x = 200;
pts4.y = 100;
pts5.x = 300;
pts5.y = 200;
pts6.x = 400;
pts6.y = 150;
pts7.x = 250;
pts7.y = 100;
pts8.x = 350;
pts8.y = 50;
status = api.fnFIE_cg_calc_cross_8point(pts1, pts2, pts3, pts4, pts5, pts6, pts7, pts8, ref cross);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
ConsoleOut.WriteFunctionName(":\n");
Console.WriteLine("8npoint cross.x: {0}", cross.x);
Console.WriteLine("8npoint cross.y: {0}", cross.y);
Console.Write(" ...");
ConsoleOut.IsTrue(cross.x == ans_cross.x && cross.y == ans_cross.y);
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_cg_calc_cross_8point()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim pts1 As New DPNT_T()
Dim pts2 As New DPNT_T()
Dim pts3 As New DPNT_T()
Dim pts4 As New DPNT_T()
Dim pts5 As New DPNT_T()
Dim pts6 As New DPNT_T()
Dim pts7 As New DPNT_T()
Dim pts8 As New DPNT_T()
Dim cross As New DPNT_T()
Dim ans_cross As DPNT_T = DPNT_T.init(225, 175)
pts1.x = 50
pts1.y = 150
pts2.x = 150
pts2.y = 200
pts3.x = 100
pts3.y = 50
pts4.x = 200
pts4.y = 100
pts5.x = 300
pts5.y = 200
pts6.x = 400
pts6.y = 150
pts7.x = 250
pts7.y = 100
pts8.x = 350
pts8.y = 50
status = api.fnFIE_cg_calc_cross_8point(pts1, pts2, pts3, pts4, pts5, pts6, _
pts7, pts8, cross)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
ConsoleOut.WriteFunctionName(":" & vbLf)
Console.WriteLine("8npoint cross.x: {0}", cross.x)
Console.WriteLine("8npoint cross.y: {0}", cross.y)
Console.Write(" ...")
ConsoleOut.IsTrue(cross.x = ans_cross.x AndAlso cross.y = ans_cross.y)
End Sub
End Class |
See Also