added polynomials
This commit is contained in:
		
							
								
								
									
										34
									
								
								gallery/example4.typ
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								gallery/example4.typ
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| #import "/src/lib.typ": * | ||||
|  | ||||
| #let p = poly.poly(0,1,2,3,4) | ||||
| #let q = poly.poly(5,6,7) | ||||
|  | ||||
| #let a = poly.add(p, q) | ||||
| #let b = poly.sub(p, q) | ||||
|  | ||||
| $ | ||||
|   p = #poly.display(p) quad q = #poly.display(q)\ | ||||
|   p + q = #poly.display(a)\ | ||||
|   p - q = #poly.display(b)\ | ||||
| $ | ||||
|  | ||||
| #let P = poly.poly(7, -3, -3, 1, 1) | ||||
| #let Q = poly.poly(-2, 1, 1) | ||||
|  | ||||
| $ | ||||
|   P = #poly.display(P) quad Q = #poly.display(Q)\ | ||||
|   P / Q = #poly.display(P) / #poly.display(Q) | ||||
| $ | ||||
|  | ||||
| #let div = poly.div(P, Q) | ||||
| #align(center, grid( | ||||
|   columns: 2, | ||||
|   align: left, | ||||
|   column-gutter: 2em, | ||||
|   row-gutter: 1em, | ||||
|   [dividend: #poly.display(div.dividend)], | ||||
|   grid.cell(rowspan: 4, (div.display)()), | ||||
|   [divisor: #poly.display(div.divisor)], | ||||
|   [quotient: #poly.display(div.quotient)], | ||||
|   [rest: #poly.display(div.rest)], | ||||
| )) | ||||
		Reference in New Issue
	
	Block a user