Skip to content

Instantly share code, notes, and snippets.

import math
for i in range(0, 360+10, 10):
cos = math.cos(math.radians(i))
sin = math.sin(math.radians(i))
print(i, cos, sin)
import math
print(math.cos(math.radians(0)))
print(math.cos(math.radians(90)))
print(math.sin(math.radians(0)))
print(math.sin(math.radians(90)))
import math
def log_plus(a, b):
print(f'{math.log(a, 10)} + {math.log(b, 10)} = {math.log(a * b, 10)}')
log_plus(2, 2)
log_plus(2, 3)
log_plus(5, 10)
import math
print(math.log(1, 10))
print(math.log(10, 10))
print(math.log(100, 10))
print(math.log(1, 2))
print(math.log(2, 2))
print(math.log(4, 2))
import math
def get_e():
n = 10000
return math.pow(1 + (1 / n), n)
print(get_e())
# @pip numpy
import numpy as np
print(np.array([1, 2, 3]) * 2);
@desktopgame
desktopgame / Root.gitignore
Last active August 17, 2020 13:05
CMake Hello library example
CMakeFiles
Testing
cmake_install.cmake
CMakeCache.txt
CTestTestfile.cmake
Makefile
*.a
*.obj
*.lib
cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Debug)
add_executable(emc_sample main.cpp)
if (EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html") # デフォルトでは.js
endif()
@desktopgame
desktopgame / main.cpp
Created June 28, 2020 03:03
emc_main
#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}
@desktopgame
desktopgame / launch.json
Created June 4, 2020 11:49
vue-typescript-electron
{
"configurations": [
{
"name": "Debug",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/dist_electron",
"program": "${workspaceRoot}/dist_electron/bundled/background.js",
"preLaunchTask": "npm: electron:build",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",