1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
%% ___ 1..2.
/
________________________________________
clear
P = [1 2], u = [3 -4]
%
P
nu = norm(u)
au = atan(u(2)/u(1))*180/pi
u
%
%
=(P,u).
u.
u.
% ___ .
hold on, grid on, axis equal , Window = [-5 5, -5 5]; axis(Window)
title( '{\bf 1..2}
=(P,{\bf u})
=(P,n).'
'fontname' ,'Cambria' , 'fontsize' ,12)
% ___
u=PQ.
Q = P+u, plot([P(1) Q(1)],[P(2) Q(2)],
'r','linewidth' ,5)
%
d = 0.2; mu = (P+Q)/2; text(mu(1)+d/2,mu(2)+d/2, '\bf u' )
%
plot(P(1),P(2), 'or','markerfacecolor' ,'r')
%
text(P(1)+d,P(2)+d, 'P')
%
text(P(1)+d,P(2)+d,[ 'P(' num2str(P(1)) ', ' num2str(P(2)) ')'])
, ...
u=PQ.
u.
P.
P.
% .
% ___
PK ? =(P,u).
L = 2
%
PK.
v = L*u/nu
% v//u L.
K = P+v
%
K
v=PK.
plot([P(1) K(1)],[P(2) K(2)], 'ok-' , 'markerfacecolor' ,'k', 'linewidth' ,3)
text(K(1)+d,K(2)+d, 'K')
%
K.
% :
MATLAB function handle. ________________
r = @(P,u,t) P+t*u/norm(u)
%
function handle: r. |
Keq = r(P,u,2)
%
r.
|
plot([P(1) Keq(1)],[P(2) Keq(2)], 'k--' )
%
.. PK. _____________________|
% ___
=(P,u) .. P.
v = 20*u/nu
B = P+v, A = P-v
plot([A(1) B(1)],[A(2) B(2)], 'k--' )
%
%
%
%
.. P.
v//u ( ).
B
.. P.
..
% ___
=(P,n).
n = [u(2) -u(1)]
%
n u ( ).
N = P+n, plot([P(1) N(1)],[P(2) N(2)],
'c','linewidth' ,6)
mn = (P+N)/2+d/2; text(mn(1),mn(2),
'\bf n' )
n2 = 30*n/norm(n)
% n2//n ( ).
B = P+n2, A = P-n2
%
B
.. P.
plot([A(1) B(1)],[A(2) B(2)], 'k--' )
% .. ? =(P,n).
%
%
n=PN.
n.
% ___
=(P,u) =(P,n).
syms x y t real
%
.
Eeq = P'+t*u', Keq = P'+t*n'
%
=(P,u) =(P,u).
FigE = ezplot(Eeq(1),Eeq(2)); set(FigE, 'color' ,'k')
% . . =(P,u).
FigK = ezplot(Keq(1),Keq(2)); set(FigK, 'color' ,'k')
% . .
=(P,u).
axis(Window)
%
.
Eeq = (x-P(1))/u(1)-(y-P(2))/u(2)
% ()
=(P,u).
Keq = (x-P(1))/n(1)-(y-P(2))/n(2)
% ()
=(P,n).
r = [x y]
%
(x,y)
=(P,u).
Eeq = det([r-P; u])
%
( )
=(P,u).
Keq = det([r-P; n])
%
( )
=(P,n).
Eeq = det([[r;P;B] ones(3,1)])
% : =(P,PB)
P .
Eeq = det([[r;P;N] ones(3,1)])
% : =(P,PN)
P N.
Eeq = dot(r-P,n), Keq = dot(r-P,u)
%
=(P,u) =(P,n).
Eeq = (r-P)*n',
Keq = (r-P)*u'
% .
FigE = ezplot(Eeq,Window); set(FigE, 'color' ,'k')
%
. . =(P,u).
FigK = ezplot(Keq,Window); set(FigK, 'color' ,'k')
%
. . =(P,u).
%
=(P,u) =(P,n).
title([ '{\bf 1..2}
=(P,{\bf u}): '
char(Eeq) ' = 0' ...
'\newline
=(P,{\bf n}): '
char(Keq) ' = 0' ], ...
'fontname' ,'Cambria' , 'fontsize' ,12)
%% ___ 1..3.
___________________________________________
clear
syms x y x0 y0 real
%
eq = 3*x-y/2+4
.
%
.
% ___
.
s = coeffs(eq), s = s(1)
sx = coeffs(eq,x), sx = sx(2)
sy = coeffs(eq,y), sy = sy(2)
%
%
%
.
x.
y.
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
% ___
.
n = [sx sy]
eq2 = ([x y]-[x0 0])*n'
sx0 = coeffs(eq2,x0), sx0 = sx0(2)
P = double([s/sx0 0])
eq2 = ([x y]-P)*n'
u = double([n(2) -n(1)])
%
=(P,u).
% A
=((x0,0),u).
%
.
% P ( )
=(P,u).
%
=(P,u).
% () u ( n) =(P,u).
% ___ .
hold on, grid on, axis equal , Window = [-5 5, -5 5]; axis(Window)
title( '{\bf 1..2}
=(P,{\bf u})
=(P,n).'
'fontname' ,'Cambria' , 'fontsize' ,12)
, ...
% ___
=(P,u).
FigE = ezplot(eq,Window); set(FigE, 'color' ,'k')
% ___
u=PQ.
Q = P+u, plot([P(1) Q(1)],[P(2) Q(2)],
'r','linewidth' ,6)
%
d = 0.1; mu = (P+Q)/2; text(mu(1)+d,mu(2)+d, '\bf u' )
%
plot(P(1),P(2), 'or','markerfacecolor' ,'w')
%
text(P(1)+d,P(2)+d, 'P')
%
text(P(1)+d,P(2)+d,[ 'P(' num2str(P(1)) ', ' num2str(P(2)) ')'])
u=PQ.
u.
P.
P.
% .
© Copyright 2026 Paperzz