04.10.2015, 07:02
|
#4
|
ПроЭктировщик
Регистрация: 17.07.2009
Сообщений: 182
Написано 51 полезных сообщений (для 71 пользователей)
|
Ответ: Пунктирная окружность
Кстати , если кому надо , то ...
Функция Пунктирная линия с регулируемым шагом
- - - - - - - - - - - - - - - - - - - - - - - - -
шаг задаёт переменная offsete
Код под спойлером :
Function Interpolate#(stepInterpolate#, Pt_1#, Pt_2#)
Return ((1.0-stepInterpolate)*Pt_1 + stepInterpolate *Pt_2)
End Function
Function StepLine#(sPt_x# ,sPt_y#, ePt_x# ,ePt_y# , R_ = 255,G_ = 255,B_ = 255 , offsete = 4)
offsete = Int(offsete )
If offsete <1 Then offsete =1
step_line# = 1.0 /((sPt_x- ePt_x)*(sPt_x- ePt_x) + (sPt_y- ePt_y)*(sPt_y- ePt_y))^0.5 *offsete
local_step_line# = 0.0
local_step_line_2# = local_step_line# - step_line
While local_step_line<1.0
local_x# = Interpolate#(local_step_line, sPt_x, ePt_x)
local_y# = Interpolate#(local_step_line, sPt_y, ePt_y)
local_step_line_2 = local_step_line + step_line
If local_step_line_2 < 0.0 local_step_line_2 = local_step_line
local_x2# = Interpolate#(local_step_line_2, sPt_x, ePt_x)
local_y2# = Interpolate#(local_step_line_2, sPt_y, ePt_y)
switch = Not switch
If switch
Color R_ ,G_ ,B_
Line local_x , local_y ,local_x2 , local_y2
EndIf
local_step_line = local_step_line + step_line
Wend
End Function
__________________
Мой проект здесь
|
(Offline)
|
|