PHPで作図
このページの末尾へ
図形のコピー
: 三角形の面積
ヘルプ
ドット数(幅
高
)形式(
gif
jpg
)
set_scale($scale = 10, $org_x_percent = 50, $org_y_percent = 50); $lev = 0; $h = 8; $ax = -3; $ay = $lev; $bx = 5; $by = $lev; $cx = 3.5; $cy = $lev + $h; $hx = $cx; $hy = $ay; set_text_size($text_size = 12); allocate_text_color('black'); draw_marked_triangle($ax, $ay, $bx, $by, $cx, $cy, $type_a = 0, $type_b = 0, $type_c = 0, $text_a = '', $text_b = '', $text_c = '', $text_ops_a = 'A', $text_ops_b = 'B', $text_ops_c = 'C', $italic = true, $italic_ops = false, $r = 10); set_text_margin($text_margin = 4); draw_text('a', ($bx + $cx)/2, ($by + $cy)/2, O_POS_LOW_LEFT, true); draw_text('b', ($cx + $ax)/2, ($cy + $ay)/2, O_POS_LOW_RIGHT, true); draw_text('c', ($ax + $bx)/2, ($ay + $by)/2, O_POS_UP_CENTER, true); allocate_color('blue'); draw_line($cx, $cy, $hx, $hy); draw_corner_mark($hx, $hy, $bx, $by, $cx, $cy, $type = 1); draw_arc_mark($tx, $ty, $cx, $cy, $hx, $hy, $text = 'h', $italic = true, $arc_type = ARC_TYPE_DASH, $width_rate = 0.7, $text_hole_rate = 1.5); $prod = calc_inscribed_circle($ax, $ay, $bx, $by, $cx, $cy, $cent_x, $cent_y, $r, $px, $py, $qx, $qy, $rx, $ry); allocate_color('red'); draw_circle($cent_x, $cent_y, $r); draw_line($cent_x, $cent_y, $px, $py); draw_line($cent_x, $cent_y, $qx, $qy); draw_line($cent_x, $cent_y, $rx, $ry); draw_corner_mark($px, $py, $cx, $cy, $cent_x, $cent_y, $type = 1); draw_corner_mark($qx, $qy, $ax, $ay, $cent_x, $cent_y, $type = 1); draw_corner_mark($rx, $ry, $bx, $by, $cent_x, $cent_y, $type = 1); draw_arc_mark($tx, $ty, $cent_x, $cent_y, $rx, $ry, $text = 'r', $italic = true, $arc_type = ARC_TYPE_DASH, $width_rate = 0.6, $text_hole_rate = 1.5); allocate_color('green'); draw_line($cent_x, $cent_y, $ax, $ay); draw_line($cent_x, $cent_y, $bx, $by); draw_line($cent_x, $cent_y, $cx, $cy); $ca = sqrt(($cx - $ax)*($cx - $ax) + ($cy - $ay)*($cy - $ay)); $cb = sqrt(($cx - $bx)*($cx - $bx) + ($cy - $by)*($cy - $by)); $qa = sqrt(($qx - $ax)*($qx - $ax) + ($qy - $ay)*($qy - $ay)); $pb = sqrt(($px - $bx)*($px - $bx) + ($py - $by)*($py - $by)); $down = $r * 3; $a2x = $ax; $a2y = $ay - $down; $b2x = $bx; $b2y = $by - $down; $c2x = $a2x - $ca; $c2y = $a2y; $q2x = $a2x - $qa; $q2y = $a2y; $c3x = $b2x + $cb; $c3y = $b2y; $p3x = $b2x + $pb; $p3y = $b2y; $cent1_x = $cent_x; $cent1_y = $cent_y - $down; $cent2_x = $q2x ; $cent2_y = $cent1_y; $cent3_x = $p3x ; $cent3_y = $cent1_y; $r2x = $cent1_x; $r2y = $cent1_y - $r; allocate_color('black'); draw_line($c2x, $c2y, $c3x, $c3y); allocate_color('green'); draw_line($c2x, $c2y, $cent2_x, $cent2_y); draw_line($a2x, $a2y, $cent2_x, $cent2_y); draw_line($a2x, $a2y, $cent1_x, $cent1_y); draw_line($b2x, $b2y, $cent1_x, $cent1_y); draw_line($b2x, $b2y, $cent3_x, $cent3_y); draw_line($c3x, $c3y, $cent3_x, $cent3_y); draw_dash_line($cent2_x, $cent2_y, $cent3_x, $cent3_y); allocate_color('red'); draw_line($q2x, $q2y, $cent2_x, $cent2_y); draw_line($r2x, $r2y, $cent1_x, $cent1_y); draw_line($p3x, $p3y, $cent3_x, $cent3_y); draw_corner_mark($q2x, $q2y, $a2x, $a2y, $cent2_x, $cent2_y, $type = 1); draw_corner_mark($r2x, $r2y, $b2x, $b2y, $cent1_x, $cent1_y, $type = 1); draw_corner_mark($p3x, $p3y, $c3x, $c3y, $cent3_x, $cent3_y, $type = 1); draw_arc_mark($tx, $ty, $cent2_x, $cent2_y, $q2x, $q2y, $text = 'r', $italic = true, $arc_type = ARC_TYPE_DASH, $width_rate, $text_hole_rate); draw_arc_mark($tx, $ty, $cent1_x, $cent1_y, $r2x, $r2y, $text = 'r', $italic = true, $arc_type = ARC_TYPE_DASH, $width_rate, $text_hole_rate); draw_arc_mark($tx, $ty, $cent3_x, $cent3_y, $p3x, $p3y, $text = 'r', $italic = true, $arc_type = ARC_TYPE_DASH, $width_rate, $text_hole_rate); draw_text('a', ($b2x + $c3x)/2, ($b2y + $c3y)/2, O_POS_UP_CENTER, true); draw_text('b', ($c2x + $a2x)/2, ($c2y + $a2y)/2, O_POS_UP_CENTER, true); draw_text('c', ($a2x + $b2x)/2, ($a2y + $b2y)/2, O_POS_UP_CENTER, true); allocate_color('purple'); calc_2p_arc($qx - $r, $qy + $r / 2, $cent2_x, $cent2_y + $r / 2, $r * 0.7, $tcent_x, $tcent_y, $tr, $tsa, $tea); draw_arc($tcent_x, $tcent_y, $tr, $tsa, $tea); calc_2p_arc($cent3_x + $r / 2, $cent3_y + $r / 2, $px + $r, $py + $r / 2, $r * 0.3, $tcent_x, $tcent_y, $tr, $tsa, $tea); draw_arc($tcent_x, $tcent_y, $tr, $tsa, $tea); draw_line($cent1_x, $cent1_y + $r / 2, $cent1_x, $cent1_y + $r * 1.5); draw_arrow_head($cent2_x, $cent2_y + $r / 2 + 1, $cent2_x, $cent2_y + $r / 2); draw_arrow_head($cent3_x + $r / 2, $cent3_y + $r / 2 + 1, $cent3_x + $r / 2, $cent3_y + $r / 2); draw_arrow_head($cent1_x, $cent1_y + $r / 2 + 1, $cent1_x, $cent1_y + $r / 2);
テンプレートを選択するとプログラムに追加されます。
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)
作図プログラムをコンパイルして図形を仮表示する
仮表示
作図プログラムをサーバに保存するには、やる勉にログインしてください。
日付順
名前順
図形の新規作成
ログイン
図形の新規作成
ログイン
このページの先頭へ