くだすれPython(超初心者用) その46【Ruby禁止】at TECH
くだすれPython(超初心者用) その46【Ruby禁止】 - 暇つぶし2ch43:デフォルトの名無しさん
20/01/05 00:25:24.67 cNQ0xZ86.net
forの中のif 文がよく似てる感じなのですが
まとめれないでしょうか?
階層が深くて分かりにくくなってしまいました
*マークは字下げです
plane_angle = []
for i , h in enumerate(ho):
****if i >= len(ho) - 1:
********if ho[0].dot(ho[i])<-1:
************ang=0
********else:
************ang=acos(ho[0].dot(ho[i]))
************if ho[i].cross(ho[0]).z<0:
****************ang=pi+ang
************else:
****************ang=pi-ang
****else:
********if ho[i+1].dot(ho[i])<-1:
************ang = 0
********else:
************ang = acos(ho[i+1].dot(ho[i]))
************if ho[i].cross(ho[i+1]).z<0:
****************ang = pi + ang
************else:
****************ang = pi-ang
****plane_angle.append(ang)


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch