PHPで作図
このページの末尾へ
図形のコピー
: 平行線と三角形
ヘルプ
ドット数(幅
高
)形式(
gif
jpg
)
set_scale($scale = 10, $org_x_percent = 0, $org_y_percent = 66); draw_text('対頂角', 0, 10, O_POS_UP_LEFT); draw_line($s1x = 1, $s1y = 7, $e1x = 9, $e1y = 3); draw_line($s2x = $s1x, $s2y = $e1y, $e2x = $e1x, $e2y = $s1y); calc_intersec_pt_of_lns($s1x, $s1y, $e1x, $e1y, $s2x, $s2y, $e2x, $e2y, $px, $py); draw_corner_mark($px, $py, $s1x, $s1y, $s2x, $s2y, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false); draw_corner_mark($px, $py, $e1x, $e1y, $e2x, $e2y, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false); allocate_color('red'); draw_corner_mark($px, $py, $s2x, $s2y, $e1x, $e1y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 8); draw_corner_mark($px, $py, $e2x, $e2y, $s1x, $s1y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 8); allocate_color('black'); set_scale($scale = 10, $org_x_percent = 33, $org_y_percent = 66); draw_text('同位角', 0, 10, O_POS_UP_LEFT); draw_line($s1x = 1, $s1y = 7, $e1x = 9, $e1y = 7); draw_line($s2x = $s1x, $s2y = 3, $e2x = $e1x, $e2y = 3); draw_line($s3x = 3, $s3y = 1, $e3x = 7, $e3y = 9); calc_intersec_pt_of_lns($s1x, $s1y, $e1x, $e1y, $s3x, $s3y, $e3x, $e3y, $p1x, $p1y); calc_intersec_pt_of_lns($s2x, $s2y, $e2x, $e2y, $s3x, $s3y, $e3x, $e3y, $p2x, $p2y); draw_arrow_head($s1x, $s1y, $x2 = 8, $s1y); draw_arrow_head($s2x, $s2y, $x2 = 8, $s2y); allocate_color('red'); draw_corner_mark($p1x, $p1y, $e1x, $e1y, $e3x, $e3y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 8); draw_corner_mark($p2x, $p2y, $e2x, $e2y, $e3x, $e3y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 8); allocate_color('black'); draw_text('l', $s1x, $s1y, $o_pos = O_POS_MIDDLE_RIGHT); draw_text('m', $s2x, $s2y, $o_pos = O_POS_MIDDLE_RIGHT); draw_text('n', $e3x, $e3y, $o_pos = O_POS_MIDDLE_RIGHT); set_scale($scale = 10, $org_x_percent = 66, $org_y_percent = 66); draw_text('錯角', 0, 10, O_POS_UP_LEFT); draw_line($s1x = 1, $s1y = 7, $e1x = 9, $e1y = 7); draw_line($s2x = $s1x, $s2y = 3, $e2x = $e1x, $e2y = 3); draw_line($s3x = 3, $s3y = 1, $e3x = 7, $e3y = 9); calc_intersec_pt_of_lns($s1x, $s1y, $e1x, $e1y, $s3x, $s3y, $e3x, $e3y, $p1x, $p1y); calc_intersec_pt_of_lns($s2x, $s2y, $e2x, $e2y, $s3x, $s3y, $e3x, $e3y, $p2x, $p2y); draw_arrow_head($s1x, $s1y, $x2 = 8, $s1y); draw_arrow_head($s2x, $s2y, $x2 = 8, $s2y); allocate_color('red'); draw_corner_mark($p1x, $p1y, $s1x, $s1y, $s3x, $s3y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 8); draw_corner_mark($p2x, $p2y, $e2x, $e2y, $e3x, $e3y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 8); allocate_color('black'); draw_text('l', $s1x, $s1y, $o_pos = O_POS_MIDDLE_RIGHT); draw_text('m', $s2x, $s2y, $o_pos = O_POS_MIDDLE_RIGHT); draw_text('n', $e3x, $e3y, $o_pos = O_POS_MIDDLE_RIGHT); set_scale($scale = 10, $org_x_percent = 0, $org_y_percent = 33); draw_text('三角形', 0, 10, O_POS_UP_LEFT); draw_marked_triangle($ax = 1, $ay = 1, $bx = 8, $by = 1, $cx = 6, $cy = 7, $type_a = 1, $type_b = 2, $type_c = 3, $text_a = '', $text_b = '', $text_c = '', $text_ops_a = '', $text_ops_b = '', $text_ops_c = '', $italic = true, $italic_ops = false, $r = 10); set_scale($scale = 10, $org_x_percent = 33, $org_y_percent = 33); draw_text('内角の和', 0, 10, O_POS_UP_LEFT); draw_marked_triangle($ax = 1, $ay = 1, $bx = 8, $by = 1, $cx = 6, $cy = 7, $type_a = 0, $type_b = 0, $type_c = 3, $text_a = '', $text_b = '', $text_c = '', $text_ops_a = '', $text_ops_b = '', $text_ops_c = '', $italic = true, $italic_ops = false, $r = 10); draw_line($s1x = $ax, $s1y = $cy, $e1x = $bx, $e1y = $cy); draw_arrow_head($ax, $ay, $x2 = 4, $ay); draw_arrow_head($s1x, $s1y, $x2 = 4, $e1y); allocate_color('red'); draw_corner_mark($ax, $ay, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($cx, $cy, $s1x, $s1y, $ax, $ay, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('green'); draw_corner_mark($bx, $by, $cx, $cy, $ax, $ay, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($cx, $cy, $bx, $by, $e1x, $e1y, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('black'); set_scale($scale = 10, $org_x_percent = 66, $org_y_percent = 33); draw_text('外角', 0, 10, O_POS_UP_LEFT); draw_marked_triangle($ax = 1, $ay = 1, $bx = 8, $by = 1, $cx = 6, $cy = 7, $type_a = 0, $type_b = 0, $type_c = 0, $text_a = '', $text_b = '', $text_c = '', $text_ops_a = '', $text_ops_b = '', $text_ops_c = '', $italic = true, $italic_ops = false, $r = 10); $vx = ($cx - $ax) / 2; $vy = ($cy - $ay) / 2; draw_line($bx, $by, $rx = 9.9, $ry = $by); draw_line($s1x = $bx, $s1y = $by, $e2x = $bx + $vx, $e2y = $by + $vy); draw_arrow_head($ax, $ay, $ax + $vx * 0.8, $ay + $vy * 0.8); draw_arrow_head($bx, $by, $bx + $vx * 0.8, $by + $vy * 0.8); allocate_color('red'); draw_corner_mark($ax, $ay, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($bx, $by, $rx, $ry, $e2x, $e2y, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('green'); draw_corner_mark($bx, $by, $cx, $cy, $ax, $ay, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('blue'); draw_corner_mark($cx, $cy, $ax, $ay, $bx, $by, $type = 3, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($bx, $by, $e2x, $e2y, $cx, $cy, $type = 3, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('black'); set_scale($scale = 10, $org_x_percent = 0, $org_y_percent = 0); draw_text('合同条件', 0, 10, O_POS_UP_LEFT); //draw_text('二辺挟角', 0, 10, O_POS_UP_LEFT); $ax = 0.5; $ay = 4; $bx = 4.5; $by = 4; $cx = 3; $cy = 8; $vx = 5; $vy = -3; for($i = 0; $i < 2; ++$i){ allocate_color('red'); draw_line($ax, $ay, $bx, $by); draw_line($cx, $cy, $ax, $ay); draw_corner_mark($ax, $ay, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('black'); draw_line($bx, $by, $cx, $cy); draw_corner_mark($bx, $by, $cx, $cy, $ax, $ay, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($cx, $cy, $ax, $ay, $bx, $by, $type = 3, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); $ax += $vx; $ay += $vy; $bx += $vx; $by += $vy; $cx += $vx; $cy += $vy; } set_scale($scale = 10, $org_x_percent = 33, $org_y_percent = 0); //draw_text('一辺両角', 0, 10, O_POS_UP_LEFT); $ax = 0.5; $ay = 4; $bx = 4.5; $by = 4; $cx = 3; $cy = 8; $vx = 5; $vy = -3; for($i = 0; $i < 2; ++$i){ allocate_color('green'); draw_line($ax, $ay, $bx, $by); draw_corner_mark($ax, $ay, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($bx, $by, $cx, $cy, $ax, $ay, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_color('black'); draw_line($bx, $by, $cx, $cy); draw_line($cx, $cy, $ax, $ay); draw_corner_mark($cx, $cy, $ax, $ay, $bx, $by, $type = 3, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); $ax += $vx; $ay += $vy; $bx += $vx; $by += $vy; $cx += $vx; $cy += $vy; } set_scale($scale = 10, $org_x_percent = 66, $org_y_percent = 0); //draw_text('三辺', 0, 10, O_POS_UP_LEFT); $ax = 0.5; $ay = 4; $bx = 4.5; $by = 4; $cx = 3; $cy = 8; $vx = 5; $vy = -3; for($i = 0; $i < 2; ++$i){ allocate_color('blue'); draw_line($ax, $ay, $bx, $by); draw_line($bx, $by, $cx, $cy); draw_line($cx, $cy, $ax, $ay); allocate_color('black'); draw_corner_mark($ax, $ay, $bx, $by, $cx, $cy, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($bx, $by, $cx, $cy, $ax, $ay, $type = 2, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark($cx, $cy, $ax, $ay, $bx, $by, $type = 3, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); $ax += $vx; $ay += $vy; $bx += $vx; $by += $vy; $cx += $vx; $cy += $vy; }
テンプレートを選択するとプログラムに追加されます。
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)
作図プログラムをコンパイルして図形を仮表示する
仮表示
作図プログラムをサーバに保存するには、やる勉にログインしてください。
日付順
名前順
図形の新規作成
ログイン
図形の新規作成
ログイン
このページの先頭へ