PHPで作図
このページの末尾へ
図形のコピー
: 三角形の垂心
ヘルプ
ドット数(幅
高
)形式(
gif
jpg
)
set_scale($scale = 20, $org_x_percent = 0, $org_y_percent = 0); $cent_x = 5; $cent_y = 5; $rad = 4; $ax = $cent_x + $rad * cos(deg2rad(80)); $ay = $cent_y + $rad * sin(deg2rad(80)); $bx = $cent_x + $rad * cos(deg2rad(180+30)); $by = $cent_y + $rad * sin(deg2rad(180+30)); $cx = $cent_x + $rad * cos(deg2rad(360-30)); $cy = $cent_y + $rad * sin(deg2rad(360-30)); calc_foot_of_perpendicular_line($px, $py, $ax, $ay, $bx, $by, $cx - $bx, $cy - $by); calc_foot_of_perpendicular_line($qx, $qy, $bx, $by, $cx, $cy, $ax - $cx, $ay - $cy); calc_foot_of_perpendicular_line($rx, $ry, $cx, $cy, $ax, $ay, $bx - $ax, $by - $ay); calc_intersec_pt_of_lns($ax, $ay, $px, $py, $bx, $by, $qx, $qy, $hx, $hy); $o1x = ($bx + $cx) / 2; $o1y = ($by + $cy) / 2; $r1 = sqrt(($bx - $cx) * ($bx - $cx) + ($by - $cy) * ($by - $cy)) / 2; $o2x = ($ax + $hx) / 2; $o2y = ($ay + $hy) / 2; $r2 = sqrt(($ax - $hx) * ($ax - $hx) + ($ay - $hy) * ($ay - $hy)) / 2; allocate_color('red'); draw_arc_deg($o1x, $o1y, $r1, $sa = -20, 200); draw_circle($o2x, $o2y, $r2); draw_line($rx, $ry, $qx, $qy); //draw_corner_mark($ax, $ay, $cx, $cy, $px, $py, CMARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); //draw_corner_mark($rx, $ry, $qx, $qy, $cx, $cy, CMARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); //draw_corner_mark($bx, $by, $qx, $qy, $cx, $cy, CMARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($ax, $ay, $bx, $by, $px, $py, CMARK_DOT, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($qx, $qy, $rx, $ry, $bx, $by, CMARK_DOT, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($cx, $cy, $rx, $ry, $bx, $by, CMARK_DOT, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); //draw_corner_mark($bx, $by, $qx, $qy, $rx, $ry, CMARK_CIRCLE, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); //draw_corner_mark($cx, $cy, $qx, $qy, $rx, $ry, CMARK_CIRCLE, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('green'); draw_line($px, $py, $ax, $ay); draw_line($qx, $qy, $bx, $by); draw_line($rx, $ry, $cx, $cy); draw_corner_mark($px, $py, $cx, $cy, $ax, $ay, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($qx, $qy, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($rx, $ry, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('black'); draw_line($ax, $ay, $bx, $by); draw_line($bx, $by, $cx, $cy); draw_line($cx, $cy, $ax, $ay); set_text_size($text_size = 12); allocate_text_color('black'); set_text_margin($text_margin = 3); draw_text('A', $ax, $ay, $o_pos = O_POS_LOW_LEFT); draw_text('B', $bx, $by, $o_pos = O_POS_UP_RIGHT); draw_text('C', $cx, $cy, $o_pos = O_POS_UP_LEFT); draw_text('P', $px, $py, $o_pos = O_POS_UP_LEFT); draw_text('Q', $qx, $qy, $o_pos = O_POS_LOW_LEFT); draw_text('R', $rx, $ry, $o_pos = O_POS_LOW_RIGHT); allocate_text_color('red'); draw_text('H', $hx, $hy, $o_pos = O_POS_UP_RIGHT);
テンプレートを選択するとプログラムに追加されます。
set_scale(...);
allocate_color('black');
allocate_color('gray');
allocate_color('red');
allocate_color('blue');
allocate_color('green');
allocate_color('purple');
allocate_bgcolor('white');
transparent_bgcolor();
set_thick($thick = 1);
set_dashlen($dashlen = 7);
set_arrow_size(...);
draw_line(...);
draw_horizontal($y);
draw_vertical($x);
draw_dash_line(...);
draw_rect(...);
draw_arrow_head(...);
draw_xaxis(...);
draw_yaxis(...);
draw_xyaxis();
draw_circle(...);
draw_arc_deg(...);
draw_arc(...);
draw_dash_arc(...);
M_PI = 3.1415926535898
M_PI_2 = pi/2
M_PI_4 = pi/4
fill_rect(...);
fill_circle(...);
fill_arc_deg(...);
fill_triangle(...);
fill_quadrangle(...);
fill_polygon();
fill_toborder($x, $y, $border_color_x, $border_color_y);
allocate_text_color('black');
allocate_text_color('gray');
allocate_text_color('red');
allocate_text_color('blue');
allocate_text_color('green');
allocate_text_color('purple');
allocate_text_bgcolor('white');
transparent_text_bgcolor();
set_text_size($text_size);
set_text_margin($text_margin);
set_mark_size($mark_size);
draw_text(...);
O_POS_LOW_LEFT
O_POS_LOW_RIGHT
O_POS_UP_RIGHT
O_POS_UP_LEFT
O_POS_LOW_CENTER
O_POS_MIDDLE_RIGHT
O_POS_UP_CENTER
O_POS_MIDDLE_LEFT
O_POS_MIDDLE_CENTER
get_o_pos_by_ang($ang);
draw_formula(...);
ARC_TYPE_NONE
ARC_TYPE_SOLID
ARC_TYPE_DASH
BEG_TYPE_ARROW
END_TYPE_ARROW
draw_arc_mark(...);
draw_corner_mark(...);
draw_marked_triangle(...);
CMARK_NONE 0
CMARK_1_ARC 1
CMARK_2_ARC 2
CMARK_D_ARC 3
CMARK_1_PIE 4
CMARK_2_PIE 5
CMARK_D_PIE 6
CMARK_SQUARE
CMARK_CROSS
CMARK_CIRCLE
CMARK_DOT
draw_mark(...);
draw_mark_on_line(...);
draw_mark_on_circle(...);
MARK_1_LINE
MARK_2_LINE
MARK_3_LINE
MARK_SQUARE
MARK_CROSS
MARK_CIRCLE
MARK_DOT
set_x_def_range(...);
df1_ax_b($a, $b);
df1_x_y($x, $y);
df1_2p($x1, $y1, $x2, $y2);
df2_ax2_bx_c(...);
df2_ax_p2_q(...);
df2_a_x_al_x_be(...);
df_y_fx($y_fx);
df_xt_yt(...);
unit_vector(...);
calc_angle(...);
normalize_ang($ang);
calc_da(...);
calc_intersec_pt_of_lines(...);
calc_intersec_pt_of_lns(...);
rot90_vec(...);
rot_vec(...);
calc_perpendicular_bisector(...);
calc_distance(...);
calc_circumscribed_circle(...);
calc_didtance_to_line(...);
calc_foot_of_perpendicular_line(...);
calc_parallel_line(...);
calc_foot_of_perpendicular_circle(...);
calc_intersec_pts_of_line_circle(...);
calc_intersec_pts_of_circles(...);
calc_inscribed_circle(...);
calc_2p_arc(...);
calc_3dview(...);
clear_canvas();
set_alphablending($alpha = 50);
set_antialias($antialias = true);
transparent_gif_bgcolor();
xf($x)
x_rev($x)
yf($y)
y_rev($y)
作図プログラムをコンパイルして図形を仮表示する
仮表示
作図プログラムをサーバに保存するには、やる勉にログインしてください。
日付順
名前順
図形の新規作成
ログイン
図形の新規作成
ログイン
このページの先頭へ