Dygraphs: is it possible to plot in negative domain? - reverse

is it possible to have the x-axis on top and y-axis on right? I would like the 0,0 location at the top right of my plot. I have depth (as negatives) on the y-axis and positive value (0-1) on the x-axis. I am using dateWindow: [1, -0.1], to reverse the plot, and it looks ok, except the x-axis should be on top.

Related

TensorFlow Object Detection API CSV file format

Im new to using TensorFlows object detection API but understand I need to convert a csv file to a TFRecord. I understand the format of the csv should be 8 columns, as follows:
filename, width, height, class, min, xmax, ymin, ymax
what im confused about is which corner of the image is assumed to be the origin?
Thanks for any help!
The top left corner of the image is assumed to be the origin (0,0), with the width (x coordinates) increasing as you move to the right and the height (y coordinates) increasing as you move downwards.
So basically, the bottom-right corner of the image would be indexed as (width-1,height-1)
The format that you described above is basically the Pascal VOC annotation format in which, for a particular bounding box
xmin denotes the x coordinate of the top left corner
ymin denotes the y coordinate of the top left corner
xmax denotes the x coordinate of the bottom right corner
ymax denotes the y coordinate of the bottom right corner

Why is the y axis inverted in the HTML DOM and in SVG?

The y axis instead of going upwards, goes downwards, whilst the x axis has the normal sense from left to right. Why?
It is one of the most annoying obstacles when doing the graphic part of a website because the geometry has to be recalculated, as the usual calculation as in the cartesian plane will be wrong. So, why does this happen? Is there a specific reason? Did they not notice that they were betraying traditional mathematics?

Finding coordinates of the circumference of circle in pygame

in pyGame, I drew 2 circles. 1 that is stationary and one that moves with the arrow keys. So, I want the moving circle to bounce back once it touches the stationary circle( I want it to bounce off the stationary circle not the window.)
To do that I need to find the coordinates of the circumference of the stationary circle. But I do not know the specific module. Can someone suggest a module or an alternate solution.
What you actually need is to find each circles center and radius, then check the distance between the centers, if the distance is less than or equal to the two radii then you know you have a collision. I'll give an example to help:
Say you have circle A, fixed at the point (0,0) with a radius of 5px.
Circle B is at (0,10) with a radius of 3px, which is moving towards the point (0,0).
So, at first we know the distance between the two centers ((0,0) and (0,10)) is 10px, and since 10 is less than 5+3 we know the two circles are not touching.
Now at some point circle B will get to the point (0,8), at this moment when we check the distance between the circles we will get 8, which is equal to 5+3, so we have a collision.
I don't know which libraries and functions you will need to do this, but hopefully this has helped you find the right thing to search for. Basically you need to get the centers, the radii and the distance between two points (the two centers).

AS3: 3D axes rotation

I've built a 3D icosahedron in AS3 that I'm going to use as a 20-sided die. With rotationX, rotationY, and rotationZ all set to 0, it looks like the top left picture. Now I'm trying to find the proper rotations for each number so that the face is perpendicular to the screen, like in the top right picture for #1. The problem is that when I rotate it one way, the axes of rotation are changed as well. For example, in the bottom left picture when I was trying to do #2, I set rotationZ to 108, but now rotationX will not turn it straight downwards as it did before.
I could just eyeball it and get approximate rotations that looked about right, but I would rather have exact rotations. Any ideas?
Nevermind, I needed to use Matrix3D instead for my rotations.

Align the coordinate labels of the triangles, so that they never collide with each other. Actionscript 3

Im trying to achieve something similar to the flash movie in the below link.
http://mathopenref.com/coordtrianglearea.html
As we drag the points of the triangle, the coordinates labels, ( A(1,2)) are properly aligned and arrange themselves so that they never collide with each other and never falls inside the triangle.
Please guide me..
Thanks in advance.
in the example you gave, the textfield seems to be aligned outside the triangle on the angle bisection of the corresponding corner.
for the position in one corner, take the two vectors to the other corners. normalize them and then add them and normalize the resulting vector again. this gives you the vector v of the angle bisection in that corner. multiply the vector with a negative constant and add it to the corner, and you'll obtain a position p outside the triangle. finally, if the angle of v is between pi/2 and -pi/2 (pointing right) align the right border of the label to p, and the left border otherwise.
for simple vector calculations, please see flash.geom.Point.