ホーム › Graphics.Direct2D › D2D1Tan
D2D1Tan
関数指定角度の正接を算出する。
シグネチャ
// d2d1.dll
#include <windows.h>
FLOAT D2D1Tan(
FLOAT angle
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| angle | FLOAT | in |
戻り値の型: FLOAT
各言語での呼び出し定義
// d2d1.dll
#include <windows.h>
FLOAT D2D1Tan(
FLOAT angle
);[DllImport("d2d1.dll", ExactSpelling = true)]
static extern float D2D1Tan(
float angle // FLOAT
);<DllImport("d2d1.dll", ExactSpelling:=True)>
Public Shared Function D2D1Tan(
angle As Single ' FLOAT
) As Single
End Function' angle : FLOAT
Declare PtrSafe Function D2D1Tan Lib "d2d1" ( _
ByVal angle As Single) As Single
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
D2D1Tan = ctypes.windll.d2d1.D2D1Tan
D2D1Tan.restype = ctypes.c_float
D2D1Tan.argtypes = [
ctypes.c_float, # angle : FLOAT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('d2d1.dll')
D2D1Tan = Fiddle::Function.new(
lib['D2D1Tan'],
[
Fiddle::TYPE_FLOAT, # angle : FLOAT
],
Fiddle::TYPE_FLOAT)#[link(name = "d2d1")]
extern "system" {
fn D2D1Tan(
angle: f32 // FLOAT
) -> f32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("d2d1.dll")]
public static extern float D2D1Tan(float angle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'd2d1_D2D1Tan' -Namespace Win32 -PassThru
# $api::D2D1Tan(angle)#uselib "d2d1.dll"
#func global D2D1Tan "D2D1Tan" float
; D2D1Tan angle ; 戻り値は stat
; angle : FLOAT -> "float"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "d2d1.dll"
#cfunc global D2D1Tan "D2D1Tan" float
; res = D2D1Tan(angle)
; angle : FLOAT -> "float"; FLOAT D2D1Tan(FLOAT angle)
#uselib "d2d1.dll"
#cfunc global D2D1Tan "D2D1Tan" float
; res = D2D1Tan(angle)
; angle : FLOAT -> "float"import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
d2d1 = windows.NewLazySystemDLL("d2d1.dll")
procD2D1Tan = d2d1.NewProc("D2D1Tan")
)
// angle (FLOAT)
r1, _, err := procD2D1Tan.Call(
uintptr(math.Float32bits(angle)),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // FLOAT
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。function D2D1Tan(
angle: Single // FLOAT
): Single; stdcall;
external 'd2d1.dll' name 'D2D1Tan';result := DllCall("d2d1\D2D1Tan"
, "Float", angle ; FLOAT
, "Float") ; return: FLOAT●D2D1Tan(angle) = DLL("d2d1.dll", "float D2D1Tan(float)")
# 呼び出し: D2D1Tan(angle)
# angle : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。