I have an object that has an existing pitch(z) value and I would like to have a function that takes in any given yaw(y) and applies it as a WORLD rotation. What sort of equation could I use. I am not well versed when it comes to all this so as much dummified info as I could get!
Related
So i have been stuck on this for a while now, I would like to make a function that gets every point on a line and excludes all the other points, given two points, given that a point is defined as (Int , Int)
Thank you
Bresenham's Algorithm is probably the algorithm you want to use. There's an implementation of it on the Haskell wiki, although if you're learning Haskell it might be a good idea to try writing it yourself.
I am fairly new to AE. I am aware of JS expressions. I have a programming background.
I have the following type of data that I want to visualise.....
I have about 10,000 different elements (locations in a city). Each of these elements occur during the last 10 years (I will compress this into 60 seconds).
When each element occurs..I want a small sphere to appear. This sphere will occur somewhere in the X,Y space (depending on its lattitude and longitude).
To provide some context ... the data is a series of house sales. The larger the price of the sale...the larger the sphere....
Becuase of the large number of elements. It is not possible (nor desirable) to manually do this in AE.
So...my question is....how can I programmatically do this in AE...?
Is it possible...?
Or perhaps should I write a program to automatically create some type of SVG that I could then import into AE...?
Or another approach entirely...?
Any ideas ... on a basic approach would be welcome.
Thanks,
Mark
Q1: So...my question is....how can I programmatically do this in AE...?
A1: You can use the ExtendScript API to run a Javascript that creates your elements.
Q2: Is it possible...?
A2: Yes.
Q3: Or perhaps should I write a program to automatically create some type of SVG that I could then import into AE...?
A3: You can't import SVG into AE (as far as I know).
Q4: Or another approach entirely...?
A4: No. You are in the right spot (IMHO).
You could use my two scripts (Warning: shameless self promotion) for creating maps and location markers in an AE comp.
Locations creates the markers for you http://aescripts.com/locations/ from CSV files.
AEMaps creates the Map http://aescripts.com/aemap/ for you from geojson files.
Or checkout GeoLayers by Markus Bergelt http://aescripts.com/geolayers/ which does the same but in a different way.
To add the price/size to your sphere you need to do some additional scripting. I suggest hacking on Locations for that.
The function add_projected_marker in line 1814 should be a good entrypoint to add additional expressions to you newly created layer.
You could add an expression like this to the scale property (where v is the value you read from your csv):
layer.transform.scale.expression = "var v = 50;\n[v,v];"
To get the data into the the locdata object you need to hack on the function win.read_button.onClick in line 1181.
I've been building a parser for STEP-formatted data (specifically the ISO 10303-21 standard), but I've run into a roadblock revolving around a single character - '$'.
A quick Google search reveals that in STEP, this character denotes an 'unset' value, I interpreted this as an uninitialized value, however I don't know exactly what I should do with it.
For example, take the following definitions:
#111=AXIS2_PLACEMENT_3D('Circle Axis2P3D',#109,#110,$) ;
#109=CARTESIAN_POINT('Axis2P3D Location',(104.14,0.,0.)) ;
#110=DIRECTION('Axis2P3D Direction',(1.,-0.,0.)) ;
To me I cannot see how this would even work, as the reference direction is uninitialized, and therefore an x-axis cannot be derived, meaning that anything using this Axis2Placement would also have undefined data.
Normally when I reach this point, I would just define some sort of default data for the given data-type (Vertices (0,0,0), Directions(1,0,0), etc.), however this doesn't seem to work, because there's the chance that my default direction would cause conflicts with the supplied data.
I have Googled what to do in this scenario, only to come up with nothing.
I also have a PDF for a very similar STEP format (ISO-10303-42), but it too doesn't mention any sort of default data, or provide any more insight in to how this works.
So, to explicitly state my question: what do I do with uninitialized data in STEP (ISO 10303-21) data?
You need to be able to represent 'unset' as a distinct value. It doesn't mean the same thing as an uninitialized value or a default value. For example you might represent AXIS2_PLACEMENT_3D as an object with data members that are pointers to point to CARTESIAN_POINT and DIRECTION, and the $ means that that pointer will be null in your representation.
Dealing with null values will depend on the context. It may be some kind of error if the data is really necessary. Or it may be that the data isn't necessary, such as if you don't need the axis to be oriented, and a point and direction are sufficient to represent the data.
In this case: #111 is local coordinate system with following 4 attributes:
character name;
pointer to origin (#109);
pointer to axis (#110);
pointer to second axis (reference direction).
If #111 is a coordinate system of circle (I guess it with 'name' value), axis is normal of circle plane, while reference direction points to start of circle (position of zero t parameter of circle). Since a circle is closed curve, you can locate this zero t position in arbitrary place, it has no influence on circle geometric shape, reference direction in this case is not mandatory, and is omitted. And it is your choice how you handle this situation.
When $ sign is used , the value is not required. Specifically, if there are a series of optional values and you want to specify a value for, let's say, 3rd optional argument and you don't want to specify values for the 1st and 2nd optional arguments, you can use $ sign for those two.
Take a look here for a better description.
I am receiving as input a "map" represented by strings, where certain nodes of the map have significance (s). For example:
---s--
--s---
s---s-
s---s-
-----s
My question is, what reasonable options are there for representing this input as an object.
The only option that really comes to mind is:
(1) Each position translated to node with up,down,left,right pointers. The whole object contains a pointer to top right node.
This seems like just a graph representation specific to this problem.
Thanks for the help.
Additionally, if there are common terms for this type of input, please let me know
Well, it depends a lot on what you need to delegate to those objects. OOP is basically about asking objects to perform things in order to solve a given problem, so it is hard to tell without knowing what you need to accomplish.
The solution you mention can be a valid one, as can also be having a matrix (in this case of 6x5) where you store in each matrix cell an object representing the node (just as an example, I used both approaches once to model the Conway's game of life). If you could give some more information on what you need to do with the object representation of your map then a better design can be discussed.
HTH
Suppose I have a list of numbers and I've computed the q-quantile (using Quantile).
Now a new datapoint comes along and I want to update my q-quantile, without having stored the whole list of previous datapoints.
What would you recommend?
Perhaps it can't be done exactly without, in the worst case, storing all previous datapoints.
In that case, can you think of something that would work well enough?
One idea I had, if you can assume normality, is to use the inverse CDF instead of the q-quantile.
Keep track of the sample variance as you go and then you can compute InverseCDF[NormalDistribution[sampleMean,sampleVariance], q] which should be the value such that a fraction q of the values are smaller, which is what the q-quantile is.
(I see belisarius was thinking along the same lines.
Here's the link he pointed to: http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm )
Unless you know that your underlying data comes from some distribution, it is not possible to update arbitrary quantiles without retaining the original data. You can, as others suggested, assume that the data has some sort of distribution and store the quantiles this way, but this is a rather restrictive approach.
Alternately, have you thought of programming this somewhere besides Mathematica? For example, you could create a class for your datapoints that contains (1) the Double value and (2) some timestamp for when the data came in. In a SortedList of these datapoints classes (which compares based on value), you could get the quantile very fast by simply referencing the index of the datapoints. Want to get a historical quantile? Simply filter on the timestamps in your sorted list.