Thứ Bảy, 27 tháng 8, 2022

pyscript

- numpy

import numpy as np from js import document import urllib #Nhập n n = 8 Y = '$$\\begin{tikzpicture}[yscale=0.87]' #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 = 'C_{'+str(i)+'}^{'+str(j)+'}' Y = Y + '\n\\path ('+str(x)+','+str(y)+') node[circle,draw=cyan]{\\color{red}{$'+str(a)+'$}};' Y = Y + '\n\\end{tikzpicture}$$' path = 'https://i.upmath.me/svg/' + urllib.parse.quote(Y, safe='') i = document.createElement('img') i.setAttribute('src', path) i.setAttribute('class', 'latex-svg') i.setAttribute('style', 'vertical-align: calc(var(--latex-zoom, 1)*-79.875pt); border: 0px; opacity: 1; width: calc(var(--latex-zoom, 1)*178.5pt); height: calc(var(--latex-zoom, 1)*159.75pt);') i.setAttribute('alt', Y) ex = document.getElementById('pi').appendChild(i)

0 Nhận xét:

Đăng nhận xét

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

<< Trang chủ