{"id":162256,"student_id":2002,"content":"library(grid)\r\n# heart function\r\nheart \u003c- function(lcolor) {\r\n t = seq(0, 2 * pi, by = 0.1)\r\n x = 16 * sin(t)^3\r\n y = 13 * cos(t) - 5 * cos(2 * t) - 2 * cos(3 * t) - cos(4 * t)\r\n a = (x - min(x))/(max(x) - min(x))\r\n b = (y - min(y))/(max(y) - min(y))\r\n grid.lines(a, b, gp = gpar(col = lcolor, lty = \"solid\", lwd = 3))\r\n}\r\nheart(\"hotpink\")\r\n\r\n# rose function\r\ngrid.newpage()\r\nrose = function() {\r\n grid.circle(x = 0.5, y = 0.5, r = 0.5, gp = gpar(fill = \"red\", \r\n lwd = 3))\r\n vp \u003c- viewport(0.5, 0.5, w = 0.9, h = 0.9)\r\n pushViewport(vp)\r\n grid.polygon(x = c(0.08, 0.5, 0.94), y = c(0.22, 1.03, 0.22), \r\n gp = gpar(lwd = 3))\r\n vp2 \u003c- viewport(0.5, 0.5, w = 0.4, h = 0.4)\r\n pushViewport(vp2)\r\n grid.circle(x = 0.5, y = 0.5, r = 0.5, gp = gpar(fill = \"red\", \r\n lwd = 3))\r\n vp3 \u003c- viewport(0.5, 0.5, w = 0.9, h = 0.9, angle = 180)\r\n pushViewport(vp3)\r\n grid.polygon(x = c(0.08, 0.5, 0.94), y = c(0.22, 1.03, 0.22), \r\n gp = gpar(lwd = 3))\r\n}\r\nrose()\r\n\r\n# pattern 1\r\ngrid.newpage()\r\npushViewport(viewport(x = 0.1, y = 0.1, w = 0.2, h = 0.2))\r\ngrid.newpage()\r\nfor (j in 1:30) {\r\n vp \u003c- viewport(0.5, 0.5, w = 0.9, h = 0.9)\r\n pushViewport(vp)\r\n heart(\"hotpink\")\r\n}\r\n\r\n# pattern 2\r\ngrid.newpage()\r\nvp1 \u003c- viewport(0.4, 0.5, w = 0.5, h = 0.5, angle = 15)\r\npushViewport(vp1)\r\nheart(\"red\")\r\nvp2 \u003c- viewport(0.9, 0.27, w = 0.7, h = 0.7, angle = -30)\r\npushViewport(vp2)\r\nheart(\"hotpink\")\r\ngrid.text(\"Happy valentine's day!\", x = 0.2, y = 1.2, just = c(\"center\", \r\n \"bottom\"), gp = gpar(fontsize = 20), vp = vp)\r\nvp3 \u003c- viewport(-0.65, 1.2, w = 0.3, h = 0.3, angle = -30)\r\npushViewport(vp3)\r\nrose()","created_at":"2020-07-04T20:13:12.187+08:00","updated_at":"2020-07-04T20:13:34.688+08:00","name":"javascript 副本","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/162256/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":47,"hashid":"yeys9p8p","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2823680,"file_name":"Gymnopedie_No_1.mp3","project_id":162256,"asset_id":182919,"created_at":"2020-07-04T20:13:12.194+08:00","updated_at":"2020-07-04T20:13:12.194+08:00"},{"id":2823681,"file_name":"koding.png","project_id":162256,"asset_id":182918,"created_at":"2020-07-04T20:13:12.195+08:00","updated_at":"2020-07-04T20:13:12.195+08:00"},{"id":2823682,"file_name":"space_bg.jpg","project_id":162256,"asset_id":182917,"created_at":"2020-07-04T20:13:12.196+08:00","updated_at":"2020-07-04T20:13:12.196+08:00"},{"id":2823683,"file_name":"earth.png","project_id":162256,"asset_id":182916,"created_at":"2020-07-04T20:13:12.197+08:00","updated_at":"2020-07-04T20:13:12.197+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦