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
##### | |
# Author: Berin | |
# Sketches repo: https://github.com/berinhard/sketches | |
# | |
# The save_video_frames function saves sketches' frames to be used by `ffmpeg` command to generate videos. | |
# For example, if we call the method with the following parameters: | |
# | |
# save_video_frames(25, 60 * 10) | |
# | |
# The ffmpeg commands to generate the video would be: |
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
/* | |
This sketch is an adaptation from Sighack's Gcode Export | |
Blog post: https://sighack.com/post/processing-boilerplate-with-gcode-export | |
*/ | |
import geomerative.*; | |
/* | |
* Gcode-generation settings. Edit these as per your needs. | |
* CONFIG_SVGS_DIR : Directory containing the SVG files | |
* CONFIG_PRINT_WIDTH_MM : The width of paper in mm |
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
class Posicao(): | |
def __init__(self, lat, lng): | |
self.lat, self.lng = lat, lng | |
@property | |
def lat(self): | |
return self._lat | |
@lat.setter |
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
class Posicao(): | |
def __init__(self, lat, lng): | |
self.set_lat(lat) | |
self.set_lng(lng) | |
def get_lat(self): | |
return self.__lat | |
def set_lat(self, value): |
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
class Posicao(): | |
def __init__(self, lat, lng): | |
self.lat, self.lng = lat, lng | |
def distancia(pos_1, pos_2): | |
#### implementação do cálculo de distância | |
def direcao(pos_1, pos_2): | |
#### implementação do cálculo de direção |
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
class Posicao(): | |
def __init__(self, lat, lng): | |
self.lat, self.lng = lat, lng | |
@property | |
def lat(self): | |
return self._lat | |
@lat.setter |
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 math | |
class Posicao(): | |
PLANA, ESFERICA, ELIPTICA = 'plana', 'esferica', 'eliptica' | |
KM, M, MILHAS = 'kms', 'm', 'miles' | |
def __init__(self, lat, lng): | |
self.lat, self.lng = lat, lng | |
self.geometria = self.PLANA | |
self.unidade = self.KM |
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 math | |
class Posicao(): | |
def __init__(self, lat, lng): | |
self.lat, self.lng = lat, lng | |
self.geometria = GeometriaPlana() | |
self.unidade = UnidadeQuilometro() | |
@property |
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
class Wallet: | |
def __init__(self, money): | |
self.money = money | |
def subtract(self, amount): | |
self.money -= amount | |
def add(self, amount): | |
self.money += amount |
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
class Wallet: | |
def __init__(self, money): | |
self.money = money | |
def subtract(self, amount): | |
self.money -= amount | |
def add(self, amount): | |
self.money += amount |