發表文章

Javascript數學函數sin與cos對比EXCEL函數

圖片
Javascript在網頁就可以執行不需要開啟Spyder sin執行 cos執行 橫軸 以上原始程式碼 <style>BUTTON{BORDER:PINK 7PX SOLID;BORDER-RADIUS:30PX;FONT-SIZE:30PX;COLOR:PURPLE}</style> <h1>Javascript在網頁就可以執行不需要開啟Spyder</h1> <button onclick="LHsin()">sin執行</button> <button onclick="LHcos()">cos執行</button> <button onclick="xLine()">橫軸</button> <canvas height="400" id="my" style="background: black;" width="1200"></canvas> <script> var c = document.getElementById("my"); var cty = c.getContext("2d"); var g = 0.01;//增加一個廣域變數,用在下面的Math.sin(g*x); var h = 195; function LHsin() { var x = 0; var y = 200; cty.beginPath();  cty.lineWidth = 5;  cty.moveTo(x,y); while (x < 1000){   x = x + 1;   y = 200 - h * Math.sin(g*x);//數學math正弦函數   cty.lineTo(x, y);   cty.strokeStyle = "yellow";   cty.stroke();    }; } function LHcos() { var x = 0; var y = 200-h;//...

三個Javascript函數sin,cos與canvas.font

圖片
郭俞汝解說程式碼 sin執行 cos執行 橫軸

郭俞汝Javascript執行三角函數繪圖

圖片
Javascript在網頁就可以執行不需要開啟Spyder 郭俞汝執行

郭俞汝python繪製三角函數與powerpoint製作影片

圖片
python程式碼 from tkinter import * #或者import tkinter as tk import math tk = Tk() #建構視窗名為tk tk.geometry('1200x400')#視窗 寬1200像素 tk.title("郭俞汝python tkinter三角函數") canvas = Canvas(tk, width=1200, height=400, bg='black') canvas.grid(row=0,column=0,padx=5,pady=5,columnspan=3) delay=2# milliseconds, 1/1000秒 x1,y1,z1=0,200,10#python特徵,多變數=對等值 h=190 #上下範圍,相當於數學的1到-1 L1=canvas.create_line(0,200,1200,200,fill='white',width=5) def YUUUU(): global x1, y1, z1#gLobel全球,Local當地 x2 = x1 + 1 #換到下一個+1 y2=200 - h*math.sin(0.02*x2) z2=200 - h*math.cos(0.02*x2) L1=canvas.create_line(x1,y1,x2,y2,fill='pink',width=10) L2=canvas.create_line(x1,z1,x2,z2,fill='white',width=10) if (x2

Word File Processing in Python(Python處理Word檔案)

圖片
embed遷入(bed床,放入床上,嵌入鑽戒) 影片重點 Let's develo; brains. 作文,在捷運上讓座let給老弱婦孺 yield(投降,收益) YTM=Yield to Maturity=到期收益率 nominal yield=coupon rate=票面利率 利用python編輯edit建立create word 檔案 Process 處理....procedure程序 SOP python命令,給文件新增加一個段落 document.add_paragraph('文字內容',格式) 網頁javascript命令 document.create_element('P'); 維基百科python了解 Python was conceived in the late 1980s [ 42 ]  by Guido van Rossum at  Centrum Wiskunde & Informatica  (CWI) in the  Netherlands ; it was conceived as a successor to the  ABC  programming language, which was inspired by  SETL , [ 43 ]  capable of  exception handling  and interfacing with the  Amoeba  operating system. [ 12 ]  Python implementation began in December 1989. [ 44 ]  Van Rossum assumed sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from responsibilities as Python's " benevolent dictator for life " (BDFL); this ...

郭俞汝Javascript網頁BUTTON按鈕ONCLICK事件call呼叫函數

物件導向設計OOP=Object-Oriented Programming 主詞subject受詞object東方的oriental id=identity,身分證id card, division區塊,段落 郭俞汝執行 函數名稱()將要用的程式碼用curly braces圍住。  JAVASCRIPT的字典 dict =new Map([["2303","聯電"],["2330","台積電"],["2880","華南金"],['AAPL','蘋果公司'],['C','花旗銀行'],['T','美國電話電報']]);//宣告配對(字典)   PYTHON的字典 dict ={"2303":"聯電","2330":"台積電","2880":"華南金",'AAPL':'蘋果公司','C':'花旗銀行','T','美國電話電報'}

郭俞汝Javascript物件導向方法是物件的函數

物件導向設計OOP=Object-Oriented Programming 主詞subject受詞object東方的oriental id=identity,身分證id card, division區塊,段落 .方法get()是取得對應的值,功能同字典 dict.get(s1.code)從dict字典取得索引為s1.code的值 郭俞汝以上的程式碼 <h1>物件導向設計OOP=Object-Oriented Programming</h1> 主詞object東方的oriental <p id="cat"></p> <p id="dog"></p> <p>id=identity,身分證id card, division區塊,段落</p> <script> dict =new Map([["2303","聯電"],["2330","台積電"],["2880","華南金"]]);//宣告配對(字典) class Stock{      //宣告類別   constructor(code, shares, price){//建構子constructor     this.code = code;     this.shares = shares;     this.price = price;} } s1 = new Stock("2330", 100, 1000); //建構子Stock建構s1 s2 = new Stock("2880", 1000, 30); //建構子Stock建構s2 st = s1.code+' 股數 '+s1.shares.toString()+'<BR>'+s2.code.toString()+' 股數 '+s2.shares; document.getElementById('cat').innerHTML = st;   st =dict.get(...