List of commits:
Subject Hash Author Date (UTC)
init b57bb8bb6a00bee9b9dc8e52e5c738b4c64ae063 fugohan 2020-03-01 17:37:55
Commit b57bb8bb6a00bee9b9dc8e52e5c738b4c64ae063 - init
Author: fugohan
Author date (UTC): 2020-03-01 17:37
Committer name: fugohan
Committer date (UTC): 2020-03-01 17:37
Parent(s):
Signing key:
Tree: a44fad29d921770b1b8cf3dcb7f4e0e888b3399b
File Lines added Lines deleted
binomischeformeln.py 89 0
latexout.tex 9 0
File binomischeformeln.py added (mode: 100644) (index 0000000..a147186)
1 import numpy as np
2 import sympy as s
3 from sympy import pprint, Symbol, sin, exp, sqrt, series, latex, symbols, simplify, expand
4 from sympy import init_printing
5
6 cols = 2
7 rows = 5
8
9 def pl(expression):
10 print(latex(expression))
11
12
13 def pls(expression):
14 print(latex(simplify(expression)))
15
16
17 def ple(expression):
18 print(latex(expand(expression)))
19
20
21 def l(expression):
22 return latex(expression)
23
24
25 def ls(expression):
26 return latex(simplify(expression))
27
28
29 def le(expression):
30 return latex(expand(expression))
31
32 def a2list(list):
33 temp = []
34 for i in range(len(list)):
35 temp.append(list[i])
36 return temp
37
38 def a2l(list):
39 temp = []
40 for i in range(len(list)):
41 temp.append(l(list[i]))
42 return temp
43 def a2le(list):
44 temp = []
45 for i in range(len(list)):
46 temp.append(le(list[i]))
47 return temp
48
49 def binomischeform1(test1):
50 out_ang = "\\begin{equation*} \n"
51 for i in range(len(a2l(test1))):
52 if i%rows is 0:
53 out_ang += "\\begin{aligned}[c]\n"+a2l(test1)[i]+"\\\\"
54 if i%rows is not 0 and i%rows is not rows-1:
55 out_ang += a2l(test1)[i] + " \\\\ "
56 if i%rows is rows-1:
57 out_ang += a2l(test1)[i]+"\n\\end{aligned} \n\\qquad\\qquad \n"
58 #out_ang = " \\\\ ".join(a2l(test1))+""
59 out_ang += "\\end{equation*}"
60 out_los = "\\section{Lösung:}\n\\begin{equation*} \n \hspace{-" + str(cols * 20) + "px}"
61 for i in range(len(a2l(test1))):
62 if i % rows is 0:
63 out_los += "\\begin{aligned}[c]\n" + a2le(test1)[i] + "\\\\"
64 if i % rows is not 0 and i % rows is not rows - 1:
65 out_los += a2le(test1)[i] + " \\\\ "
66 if i % rows is rows - 1:
67 out_los += a2le(test1)[i] + "\n\\end{aligned} \n\\qquad \n"
68 # out_ang = " \\\\ ".join(a2l(test1))+""
69 out_los += "\\end{equation*}"
70 return out_ang, out_los
71 x, y, z, a, b, c = symbols('x y z a b c')
72
73 test1 = (np.random.randint(1, 11, cols * rows)*a+np.random.randint(1, 11, cols*rows)*b)**2
74
75
76 #print(out_ang)
77
78 #print("{0}\n{1}".format(binomischeform1(test1)))
79 #print(len(binomischeform1(test1)))
80
81 b = binomischeform1(test1)
82
83 # print(b[0])
84 # print(b[1])
85
86 f = open("latexout2.tex", "w")
87 f.write("{}\n{}".format(b[0],b[1]))
88
89 #print("{}\n{}".format(b[0],b[1]))
File latexout.tex added (mode: 100644) (index 0000000..8514d3e)
1 \documentclass{article}
2
3 \usepackage{amsmath}
4 \usepackage[utf8]{inputenc}
5 %\usepackage{babel}[ngerman]
6 \begin{document}
7 \section{Binomische Form}
8 \input{latexout2.tex}
9 \end{document}
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/rocketgit-morehan/bspgen2

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/rocketgit-morehan/bspgen2

Clone this repository using git:
git clone git://git.rocketgit.com/user/rocketgit-morehan/bspgen2

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main