This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.linalg import norm | |
#------------------------------------------------------------------------------ | |
# 凸多角形か判定 | |
def isConvex(polygon): | |
# n角形 | |
n = len(polygon) | |
# 時計回りまたは反時計回りで、隣接する辺のベクトルのクロス積がすべて同符号なら凸多角形 | |
cp0 = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [PILの画素アクセスの高速化検討] | |
# 方法1: Image.getpixel/putpixel | |
# 方法2: Image.load | |
# 方法3: Image.getdata/putdata | |
# 方法4: Image.tobytes/frombytes | |
# 方法5: NumPy配列, Image.fromarray | |
# 方法6: 方法5 + NumbaによるJITコンパイル | |
from numba import jit | |
from tkinter import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Speaker2.cpp | |
* Copyright (C) 2023 MATSUOKA Takashi | |
* MIT License | |
*/ | |
//////////////////////////////////////////////////////////////////////////////// | |
// Includes | |
#include "../include/Speaker2.hpp" |