Thứ Năm, 25 tháng 8, 2022

Mẫu Pyscript

- numpy

$$\begin{tikzpicture} \path (0.0,6) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-0.5,5) node[circle,draw=cyan]{\color{red}{$1$}}; \path (0.5,5) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-1.0,4) node[circle,draw=cyan]{\color{red}{$1$}}; \path (0.0,4) node[circle,draw=cyan]{\color{red}{$1$}}; \path (1.0,4) node[circle,draw=cyan]{\color{red}{$2$}}; \path (-1.5,3) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-0.5,3) node[circle,draw=cyan]{\color{red}{$1$}}; \path (0.5,3) node[circle,draw=cyan]{\color{red}{$2$}}; \path (1.5,3) node[circle,draw=cyan]{\color{red}{$6$}}; \path (-2.0,2) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-1.0,2) node[circle,draw=cyan]{\color{red}{$1$}}; \path (0.0,2) node[circle,draw=cyan]{\color{red}{$2$}}; \path (1.0,2) node[circle,draw=cyan]{\color{red}{$6$}}; \path (2.0,2) node[circle,draw=cyan]{\color{red}{$24$}}; \path (-2.5,1) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-1.5,1) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-0.5,1) node[circle,draw=cyan]{\color{red}{$2$}}; \path (0.5,1) node[circle,draw=cyan]{\color{red}{$6$}}; \path (1.5,1) node[circle,draw=cyan]{\color{red}{$24$}}; \path (2.5,1) node[circle,draw=cyan]{\color{red}{$120$}}; \path (-3.0,0) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-2.0,0) node[circle,draw=cyan]{\color{red}{$1$}}; \path (-1.0,0) node[circle,draw=cyan]{\color{red}{$2$}}; \path (0.0,0) node[circle,draw=cyan]{\color{red}{$6$}}; \path (1.0,0) node[circle,draw=cyan]{\color{red}{$24$}}; \path (2.0,0) node[circle,draw=cyan]{\color{red}{$120$}}; \path (3.0,0) node[circle,draw=cyan]{\color{red}{$720$}}; \end{tikzpicture}$$

H-Maths

import numpy as np from js import document #Nhập n n = 6 Y = '$$\\begin{tikzpicture}' #Xử lý xuất kết quả for i in range(n+1): for j in range(i+1): x = j-0.5*i y = n - i a = int(np.math.factorial(j)) Y = Y + '\n\\path ('+str(x)+','+str(y)+') node[circle,draw=cyan]{\\color{red}{$'+str(a)+'$}};' Y = Y + '\n\\end{tikzpicture}$$' paragraph = document.getElementById('pi') paragraph.innerText = Y paragraph.contentWindow.location.reload(true)

H-Maths

def runPython(*args): pyscript.write("tpi", "$$\begin{tikzpicture}\path (0.0,6) node[circle,draw=cyan]{\color{red}{$1$}};\end{tikzpicture}$$")

0 Nhận xét:

Đăng nhận xét

Đăng ký Đăng Nhận xét [Atom]

<< Trang chủ