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 | |
def calculate_initial_compass_bearing(pointA, pointB): | |
""" | |
Calculates the bearing between two points. | |
The formulae used is the following: | |
θ = atan2(sin(Δlong).cos(lat2), | |
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong)) |
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
cypreess@iMac ~ cat f.cc | |
#include <stdio.h> | |
int main(){ | |
unsigned char a = 255; | |
unsigned long int b = (a << 24); | |
unsigned long int c = ((unsigned long int) a << 24); | |
printf("b=%lu\n", b); | |
printf("c=%lu\n", c); |