PHPで作図
このページの末尾へ
図形のコピー
: 基本軌跡
ヘルプ
ドット数(幅
高
)形式(
gif
jpg
)
set_scale($scale = 10, $org_x_percent = 0, $org_y_percent = 66); $sx = 1; $sy = 1; $ex = 9; $ey = 9; $ox = 3; $oy = 3; $px = 7; $py = 7; allocate_color('red'); draw_line($sx, $sy, $ex, $ey); draw_arrow_head($sx, $sy, $ex, $ey, $pos = 1.0, $count = 1); draw_mark($px, $py, $angle = 0, MARK_DOT); allocate_color('black'); draw_mark($ox, $oy, $angle = 0, MARK_DOT); set_text_margin($text_margin = 4); draw_text('O', $ox, $oy, $o_pos = O_POS_UP_LEFT, $italic = false); allocate_text_color('red'); draw_text('P', $px, $py, $o_pos = O_POS_UP_LEFT, $italic = false); set_scale($scale = 10, $org_x_percent = 50, $org_y_percent = 66); $sx = 3; $sy = 3; $ex = 7; $ey = 7; $ox = 5; $oy = 5; $vx = -1.7; $vy = $vx * -1; $s2x = $sx + $vx; $s2y = $sy + $vy; $e2x = $ex + $vx; $e2y = $ey + $vy; $o2x = $ox + $vx; $o2y = $oy + $vy; $s3x = $sx - $vx; $s3y = $sy - $vy; $e3x = $ex - $vx; $e3y = $ey - $vy; $o3x = $ox - $vx; $o3y = $oy - $vy; allocate_color('red'); draw_line($s2x, $s2y, $e2x, $e2y); draw_line($s3x, $s3y, $e3x, $e3y); draw_mark($o2x, $o2y, $angle = 0, MARK_DOT); draw_mark($o3x, $o3y, $angle = 0, MARK_DOT); allocate_color('green'); allocate_text_color('green'); draw_line($o2x, $o2y, $o3x, $o3y); draw_arc_mark($tx, $ty, $o2x, $o2y, $ox, $oy, $text = 'd', $italic = true, $arc_end_type = ARC_TYPE_DASH, $width_rate = 1, $text_hole_rate = 1.2); draw_arc_mark($tx, $ty, $ox, $oy, $o3x, $o3y, $text = 'd', $italic = true, $arc_end_type = ARC_TYPE_DASH, $width_rate = 1, $text_hole_rate = 1.2); draw_corner_mark($o2x, $o2y, $ox, $oy, $e2x, $e2y, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 6); draw_corner_mark($ox, $oy, $ex, $ey, $o2x, $o2y, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 6); draw_corner_mark($o3x, $o3y, $e3x, $e3y, $o2x, $o2y, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 6); allocate_color('black'); draw_line($sx, $sy, $ex, $ey); set_text_margin($text_margin = 4); allocate_text_color('black'); draw_text('l', $ex, $ey, $o_pos = O_POS_LOW_RIGHT, $italic = true); allocate_text_color('red'); draw_text('P', $o2x, $o2y, $o_pos = O_POS_LOW_RIGHT, $italic = false); draw_text('P', $o3x, $o3y, $o_pos = O_POS_UP_LEFT, $italic = false); set_scale($scale = 10, $org_x_percent = 25, $org_y_percent = 50); $ax = -4; $ay = 0; $bx = 4; $by = 0; $px = 0; $py = 3; for($i = 4.5; $i >= -4.5; $i -= 0.5){ $green = sprintf("%02x", floor(127 * ($i + 4.5) / 9) + 128); allocate_color('#cc'.$green.'99'); draw_line($ax, $ay, 0, $i); draw_line($bx, $by, 0, $i); } allocate_color('black'); draw_line($ax, $ay, $bx, $by); draw_line($ax, $ay, $px, $py); draw_line($bx, $by, $px, $py); draw_mark_on_line($ax, $ay, $bx, $by, MARK_1_LINE, $pos = 0.25); draw_mark_on_line($ax, $ay, $bx, $by, MARK_1_LINE, $pos = 0.75); draw_mark_on_line($ax, $ay, $px, $py, MARK_2_LINE, $pos = 0.5); draw_mark_on_line($bx, $by, $px, $py, MARK_2_LINE, $pos = 0.5); allocate_color('red'); draw_line($px, 4.8, $px, -4.8); draw_mark($px, $py, $angle = 0, MARK_DOT); draw_corner_mark(0, 0, $bx, $by, $px, $py, $type = 1, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); allocate_text_color('red'); draw_text('P', $px, $py, $o_pos = O_POS_LOW_RIGHT, $italic = false); set_scale($scale = 10, $org_x_percent = 75, $org_y_percent = 50); $ax = -4; $ay = -2; $bx = 4; $by = 2; $a2x = -4; $a2y = 2; $b2x = 4; $b2y = -2; $px = 0; $py = 1.8; $p2x = 3; $p2y = 0; for($i = 0.1; $i <= 0.8; $i += 0.1){ $green = sprintf("%02x", floor(127 * $i + 128)); allocate_color('#cc'.$green.'99'); $tx = $i * $ax; $ty = $i * $ay; draw_line($tx, $ty, -1 * $tx, $ty); draw_line(-1 * $tx, $ty, -1 * $tx, -1 * $ty); draw_line(-1 * $tx, -1 * $ty, $tx, -1 * $ty); draw_line($tx, -1 * $ty, $tx, $ty); } allocate_color('black'); draw_line($ax, $ay, $bx, $by); draw_line($a2x, $a2y, $b2x, $b2y); allocate_color('red'); draw_line($ax, 0, $bx, 0); draw_line(0, $ay, 0, $by); draw_mark($px, $py, $angle = 0, MARK_DOT); draw_mark($p2x, $p2y, $angle = 0, MARK_DOT); set_mark_size($mark_size = 5); draw_corner_mark(0, 0, 1, 0, $bx, $by, MARK_CIRCLE, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, $bx, $by, 0, 1, MARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, 0, 1, -1 * $bx, $by, MARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, -1 * $bx, $by, -1, 0, MARK_CIRCLE, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, -1, 0, -1 * $bx, -1 * $by, MARK_CIRCLE, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, -1 * $bx, -1 * $by, 0, -1, MARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, 0, -1, $bx, -1 * $by, MARK_CROSS, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_corner_mark(0, 0, $bx, -1 * $by, 1, 0, MARK_CIRCLE, $text = '', $italic = true, $text_ops = '', $italic_ops = false, $r = 10); draw_text('l', $bx, $by, $o_pos = O_POS_LOW_RIGHT, $italic = true); draw_text('m', $b2x, $b2y, $o_pos = O_POS_UP_RIGHT, $italic = true); allocate_text_color('red'); draw_text('P', $px, $py, $o_pos = O_POS_LOW_RIGHT, $italic = false); draw_text('P', $p2x, $p2y, $o_pos = O_POS_LOW_LEFT, $italic = false); set_scale($scale = 10, $org_x_percent = 25, $org_y_percent = 17); $cx = 0; $cy = 0; $r = 4; $px = $r * cos(M_PI / 4); $py = $r * sin(M_PI / 4); for($i = 0; $i < 1; $i += (1/24)){ $green = sprintf("%02x", floor(127 * $i + 128)); allocate_color('#cc'.$green.'99'); $tx = $r * cos($i * 2 * M_PI); $ty = $r * sin($i * 2 * M_PI); draw_line($cx, $cy, $tx, $ty); } allocate_color('black'); allocate_text_color('black'); draw_line($cx, $cy, $px, $py); draw_arc_mark($tx, $ty, $cx, $cy, $px, $py, $text = 'r', $italic = true, $arc_end_type = ARC_TYPE_DASH, $width_rate = 1, $text_hole_rate = 1.2); allocate_color('red'); allocate_text_color('red'); draw_circle($cx, $cy, $r); draw_mark($px, $py, $angle = 0, MARK_DOT); draw_text('P', $px, $py, $o_pos = O_POS_LOW_LEFT, $italic = false); set_scale($scale = 10, $org_x_percent = 75, $org_y_percent = 20); $r = 3; $cx = 0; $cy = $r * 0.5; $sa = -1 * M_PI / 6; $ea = M_PI * 7 / 6; $ax = $cx + $r * cos($sa); $ay = $cy + $r * sin($sa); $bx = $cx + $r * cos($ea); $by = $cy + $r * sin($ea); $c2x = 0; $c2y = -1 * $cy; $s2a = M_PI * 5 / 6; $e2a = M_PI * 13 / 6; for($i = 0.1; $i < 1; $i += (1/7)){ $green = sprintf("%02x", floor(127 * $i + 128)); allocate_color('#cc'.$green.'99'); $ta = (1 - $i) * $sa + $i * $ea; $tx = $cx + $r * cos($ta); $ty = $cy + $r * sin($ta); draw_line($ax, $ay, $tx, $ty); draw_line($bx, $by, $tx, $ty); $t2a = (1 - $i) * $s2a + $i * $e2a; $t2x = $c2x + $r * cos($t2a); $t2y = $c2y + $r * sin($t2a); draw_line($ax, $ay, $t2x, $t2y); draw_line($bx, $by, $t2x, $t2y); } allocate_color('red'); draw_arc($cx, $cy, $r, $sa, $ea); draw_arc($c2x, $c2y, $r, $s2a, $e2a); allocate_color('white'); set_mark_size($mark_size = 15); draw_mark($ax, $ay, $angle = 0, MARK_DOT); draw_mark($bx, $by, $angle = 0, MARK_DOT); allocate_color('red'); set_mark_size($mark_size = 10); draw_mark($ax, $ay, $angle = 0, MARK_CIRCLE); draw_mark($bx, $by, $angle = 0, MARK_CIRCLE); allocate_color('black'); allocate_text_color('black'); draw_line($ax, $ay, $bx, $by); $ta = M_PI / 6; $tx = $cx + $r * cos($ta); $ty = $cy + $r * sin($ta); draw_line($ax, $ay, $tx, $ty); draw_line($bx, $by, $tx, $ty); $t2a = M_PI * 1.4; $t2x = $c2x + $r * cos($t2a); $t2y = $c2y + $r * sin($t2a); draw_line($ax, $ay, $t2x, $t2y); draw_line($bx, $by, $t2x, $t2y); draw_corner_mark($tx, $ty, $bx, $by, $ax, $ay, $type = 1, $text = 'a', $italic = true, $text_ops = '', $italic_ops = false, $r = 6); draw_corner_mark($t2x, $t2y, $ax, $ay, $bx, $by, $type = 1, $text = 'a', $italic = true, $text_ops = '', $italic_ops = false, $r = 6); draw_text('A', $ax, $ay, $o_pos = O_POS_MIDDLE_LEFT, $italic = false); draw_text('B', $bx, $by, $o_pos = O_POS_MIDDLE_RIGHT, $italic = false); allocate_color('red'); allocate_text_color('red'); draw_mark($tx, $ty, $angle = 0, MARK_DOT); draw_text('P', $tx, $ty, $o_pos = O_POS_LOW_LEFT, $italic = false); draw_mark($t2x, $t2y, $angle = 0, MARK_DOT); draw_text('P', $t2x, $t2y, $o_pos = O_POS_UP_RIGHT, $italic = false);
テンプレートを選択するとプログラムに追加されます。
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)
作図プログラムをコンパイルして図形を仮表示する
仮表示
作図プログラムをサーバに保存するには、やる勉にログインしてください。
日付順
名前順
図形の新規作成
ログイン
図形の新規作成
ログイン
このページの先頭へ