파이썬[Python]: kivy - circumcircle 함수
kivy.geometry 모듈 - circumcircle 함수(function)
/// 설명
삼각형의 외접원에서 중심과 반지름을 구합니다.
참고: animation to gesture 모듈 목록
※ 형식
circumcircle()
reference
https://kivy.org/doc/stable/api-kivy.geometry.html
참고: animation to gesture 모듈 목록
※ 형식
circumcircle()
reference
https://kivy.org/doc/stable/api-kivy.geometry.html
/// 예제
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 | import kivy kivy.require('2.0.0') from kivy.app import App from kivy.core.window import Window from kivy import geometry from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.label import Label Window.clearcolor = (1, 1, 1, 1) Window.size = (563, 1001) Window.top, Window.left = 30, 2900 class FantasticApp(App): def _bt_circle(self, bt_instance): circle = geometry.circumcircle([0, 0], [3, 0], [3, 4]) self.lb.text = 'point(0, 0), point(3, 0), point(3, 4)\n' + \ 'center: ' + str(circle[0]) + '\n'\ 'radius: ' + str(circle[1]) def build(self): self.lb = lb = Label(text='point(0, 0), point(3, 0), point(3, 4)\n' + \ 'center: ?\n' + \ 'radius: ?', color='black') bt = Button(text='center and radius') bt.bind(on_press=self._bt_circle) bl = BoxLayout(orientation='vertical') bl.add_widget(lb) bl.add_widget(bt) return bl FantasticApp().run() | cs |
/// 출력
* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)
– 당신을 응원합니다. –
댓글
댓글 쓰기