プログラミングのお題スレ Part22 (857レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
403: デフォルトの名無しさん [sage] 2024/08/10(土) 08:54:23.54 ID:DYGkQoQe(1) AAS
REM 座標計算.bat
chcp 65001
ruby -x "%~f0"
goto end
#~
#!ruby
#encoding: utf-8
Encoding.default_external='UTF-8'
require "matrix"
while 1
print "input start point > " #0,0
p1=$stdin.gets.split(",").map{|e| e.to_f}
print "input end point > " #120,0
p2=$stdin.gets.split(",").map{|e| e.to_f}
print "input length > " #50
l=$stdin.gets.to_f
exit if l<=0
p1[1]=0 unless p1[1]
p2[1]=0 unless p2[1]
v1=Vector.elements(p1)
v2=Vector.elements(p2)
m=(v2-v1).r
n=(m/l).to_i
a=(0..n).map{|e| l*e}
b=a.map{|e| v1+(v2-v1)*(e/(v2-v1).r)}.map{|e| e.to_a}
b<<p2
p b.uniq
end
__END__
:end
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.045s