瀏覽代碼

minor tweaks

clementinecomputing 5 年之前
父節點
當前提交
c642729e16
共有 2 個文件被更改,包括 53 次插入1 次删除
  1. 52 0
      busunit/helper/gpsdist.c
  2. 1 1
      experiment/production/housing/v-alfalfa-sprout/housing_layout_3d.scad

+ 52 - 0
busunit/helper/gpsdist.c

@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 Clementine Computing LLC.
+ *
+ * This file is part of PopuFare.
+ * 
+ * PopuFare is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * PopuFare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Affero General Public License
+ * along with PopuFare.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "../common/gpsmath.h"
+
+void usage(FILE *fp) {
+  fprintf(fp, "\nusage:\n\n");
+  fprintf(fp, "  gpsdist <lat0> <lon0> <lat1> <lon1>");
+  fprintf(fp, "\n\n");
+}
+
+int main(int argc, char **argv) {
+  float lat0, lon0, lat1, lon1;
+  float dist;
+
+  if (argc < 5) {
+    usage(stderr);
+    exit(-1);
+  }
+
+  lat0 = atof(argv[1]);
+  lon0 = atof(argv[2]);
+  lat1 = atof(argv[3]);
+  lon1 = atof(argv[4]);
+
+  dist = GPS_Dist(lat0, lon0, lat1, lon1);
+
+  printf("Distance = %f meters\n", dist);
+
+}
+

+ 1 - 1
experiment/production/housing/v-alfalfa-sprout/housing_layout_3d.scad

@@ -67,7 +67,7 @@ translate( [ 0, dw/2 - 50, dz + spacing] ) PopufareHousingTopPlate();
 
 //---
 
-translate([  0, -1.5*dh, 30])
+translate([  0, -1.3*dh, 90])
   rotate(45, [1,0,0])
   PopufareHousingInnerBackPlate();