-
Notifications
You must be signed in to change notification settings - Fork 0
/
Elements.lua
5546 lines (5354 loc) · 218 KB
/
Elements.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Bundled by luabundle {"version":"1.6.0"}
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
local loadingPlaceholder = { [{}] = true }
local register
local modules = {}
local require
local loaded = {}
register = function(name, body)
if not modules[name] then
modules[name] = body
end
end
require = function(name)
local loadedModule = loaded[name]
if loadedModule then
if loadedModule == loadingPlaceholder then
return nil
end
else
if not modules[name] then
if not superRequire then
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
error('Tried to require ' .. identifier .. ', but no such module has been registered')
else
return superRequire(name)
end
end
loaded[name] = loadingPlaceholder
loadedModule = modules[name](require, loaded, register, modules)
loaded[name] = loadedModule
end
return loadedModule
end
return require, loaded, register, modules
end)(require)
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
--This module was created by Tan Choon Yong 2023
--[[ GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.]]
---@diagnostic disable: duplicate-set-field
Elements = require("Data").Elements
local function Reverse(t)
local r = {}
for k, v in pairs(t) do
r[v] = k
end
return r
end
local function tchelper(first, rest)
return first:upper() .. rest:lower()
end
local function dump(o)
if type(o) == 'table' then
local s = '{'
for k, v in pairs(o) do
if type(k) ~= 'number' then k = '"' .. k .. '"' end
s = s .. k .. '=' .. dump(v) .. ','
end
s = s:sub(1, -2) .. "}"
return s
else
return tostring(o)
end
end
local function reverseTable(t)
local out = {}
for k, v in pairs(t) do
out[v] = k
end
return out
end
---@param t any
---@param s any
---@return table
local function Locateinit(t, s)
local reversedElements = {}
for k, v in pairs(t) do
if type(v[s]) ~= "nil" then
reversedElements[v[s]] = k
end
end
return reversedElements
end
function HCF(x, y)
if y == 0 then
return x
end
local r = (x % y)
return HCF(y, r)
end
---Calculate the Highest Common Factor/Greatest Common Divisor
---@param t table
---@return integer
function MultiHCF(t)
local out = {}
if #t == 1 then
return t[1]
end
for i in ipairs(t) do
if t[i] == 1 then
return 1
end
if i < #t then
table.insert(out, HCF(t[i], t[i + 1]))
end
end
--print(dump(out))
if #out == 1 then
return out[1]
else
return MultiHCF(out)
end
end
---comment
---@param t table
---@return table
local function formatCompound(t)
local out = {}
if type(t[2]) ~= "number" then
for k, v in pairs(t) do
if type(v) == "table" then
if v[2] ~= nil then
table.insert(out, { v[1], v[2] })
else
table.insert(out, { v[1], 1 })
end
elseif type(v) == "string" then
table.insert(out, { v, 1 })
end
end
else
table.insert(out, { t[1], t[2] })
end
return out
end
---@param t table
---@param search string
---@param element string
---@param r string
---@return any
local function Locatemain(t, search, element, r)
local index = Locateinit(t, search)[element]
local TheElement = t[index]
if type(TheElement) == "table" then
if type(TheElement[r]) == "table" then
print("table")
return "{" .. table.concat(TheElement[r], ",") .. "}"
else
return TheElement[r]
end
else
return nil
end
end
--- Locates something of an element
---@param I string
---@param W string
---@param O string
---@return string
local function locate(I, W, O)
return Locatemain(Elements, I:lower(), W, O:lower())
end
---Calculates Mass
---@param ... any
---@return number
local function mass(...)
local mass = 0
local args = { ... }
if #args == 1 and type(args[1]) == "table" then
args = args[1]
end
local formatted = formatCompound(args)
for k, v in pairs(formatted) do
mass = mass + (locate("symbol", v[1], "atomic_mass") * v[2])
end
return mass
end
local function compoundSearch(t)
local out = {}
for k, v in pairs(t) do
out[v[1]] = v[2]
end
return out
end
local function reverseCompoundSearch(t)
local out = {}
for k, v in pairs(t) do
table.insert(out, { k, v })
end
return out
end
Compound = {}
---new Compound
---@param t table
---@return table
function Compound:new(t)
local o = {}
self.__index = self
o.value = formatCompound(t)
o.mass = mass(o.value)
setmetatable(o, self)
return o
end
function Compound:percentageByMass(Element)
local numberOfElements = compoundSearch(self.value)[Element]
local massOfElement = mass({ Element, numberOfElements })
return massOfElement / self.mass
end
function Compound:getAmount(args)
local returntype = args["returnValue"]
local moles = nil
if args.grams ~= nil then
moles = args.grams / self.mass
elseif args.moles ~= nil then
moles = args.moles
end
if returntype == "moles" then
return moles
elseif returntype == "grams" then
return moles * self.mass
end
end
local function mergeCompound(...)
local out = {}
local args = { ... }
for k, v in ipairs(args) do
if (v.value ~= nil) then
local c = compoundSearch(v.value)
for j, w in pairs(c) do
if out[j] ~= nil then
out[j] = out[j] + w
else
out[j] = w
end
end
else
error "Not a Compound"
end
end
return Compound:new(reverseCompoundSearch(out))
end
function Compound:ef()
local beforeHCF = {}
local out = {}
for _, v in pairs(compoundSearch(self.value)) do
table.insert(beforeHCF, v)
end
HCF = MultiHCF(beforeHCF)
for _, v in pairs(self.value) do
--print(dump(v))
table.insert(out, { v[1], v[2] // HCF })
end
return out
end
function Compound:merge(Compound2)
return mergeCompound(self, Compound2)
end
---Temperature in Kelvin<br>
---Pressure in Pascals<br>
---Returns in cubic metres<br>
---Output either pressure, volume, mols or temperature
---@param args table
---@return number
local function idealgaslaw(args)
local pressure = args.pressure
local volume = args.volume
local mols = args.mols
local temperature = args.temperature
local output = args.output
local R = 8.31446261815324
if output == "volume" then
if volume then
return volume
elseif pressure and mols and temperature then
return (mols * R * temperature) / pressure
else
error "Not enough values"
end
elseif output == "mols" then
if mols then
return mols
elseif pressure and volume and temperature then
return (pressure * volume) / (R * temperature)
else
error "Not enough values"
end
elseif output == "pressure" then
if pressure then
return pressure
elseif volume and mols and temperature then
return (mols * R * temperature) / volume
end
elseif output == "temperature" then
if temperature then
return temperature
elseif pressure and volume and mols then
return (pressure * volume) / (mols * R)
else
error "Not enough values"
end
end
return nil or 0 or "" or false
end
function Compound:string()
local out = ""
for k, v in ipairs(self.value) do
if v[2] ~= 1 then
out = out .. v[1] .. v[2]
else
out = out .. v[1]
end
end
return out
end
--A lua module relating to the periodic table
return {
locate = locate,
table = Elements,
mass = mass,
Compound = Compound,
mergeCompound = mergeCompound,
idealgaslaw = idealgaslaw
}
end)
__bundle_register("Data", function(require, _LOADED, __bundle_register, __bundle_modules)
--Generated with Python Script
local Elements = {}
Elements[1] = {
name = "Hydrogen",
appearance = "colorless gas",
atomic_mass = 1.008,
boil = 20.271,
category = "diatomic nonmetal",
density = 0.08988,
discovered_by = "Henry Cavendish",
melt = 13.99,
molar_heat = 28.836,
named_by = "Antoine Lavoisier",
number = 1,
period = 1,
group = 1,
phase = "Gas",
source = "https://en.wikipedia.org/wiki/Hydrogen",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_001_hydrogen/element_001_hydrogen_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_001_hydrogen/element_001_hydrogen.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Hydrogen_Spectra.jpg",
summary =
"Hydrogen is a chemical element with chemical symbol H and atomic number 1. With an atomic weight of 1.00794 u, hydrogen is the lightest element on the periodic table. Its monatomic form (H) is the most abundant chemical substance in the Universe, constituting roughly 75% of all baryonic mass.",
symbol = "H",
xpos = 1,
ypos = 1,
wxpos = 1,
wypos = 1,
shells = { 1, },
electron_configuration = "1s1",
electron_configuration_semantic = "1s1",
electron_affinity = 72.769,
electronegativity_pauling = 2.2,
ionization_energies = { 1312, },
cpk_hex = "ffffff",
image = { title = "Vial of glowing ultrapure hydrogen, H2. Original size in cm: 1 x 5",
url = "https://upload.wikimedia.org/wikipedia/commons/d/d9/Hydrogenglow.jpg",
attribution =
"User:Jurii, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/hydrogen.php", },
block = "s",
}
Elements[2] = {
name = "Helium",
appearance = "colorless gas, exhibiting a red-orange glow when placed in a high-voltage electric field",
atomic_mass = 4.0026022,
boil = 4.222,
category = "noble gas",
density = 0.1786,
discovered_by = "Pierre Janssen",
melt = 0.95,
molar_heat = nil,
named_by = nil,
number = 2,
period = 1,
group = 18,
phase = "Gas",
source = "https://en.wikipedia.org/wiki/Helium",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_002_helium/element_002_helium_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_002_helium/element_002_helium.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Helium_spectrum.jpg",
summary =
"Helium is a chemical element with symbol He and atomic number 2. It is a colorless, odorless, tasteless, non-toxic, inert, monatomic gas that heads the noble gas group in the periodic table. Its boiling and melting points are the lowest among all the elements.",
symbol = "He",
xpos = 18,
ypos = 1,
wxpos = 32,
wypos = 1,
shells = { 2, },
electron_configuration = "1s2",
electron_configuration_semantic = "1s2",
electron_affinity = -48,
electronegativity_pauling = nil,
ionization_energies = { 2372.3, 5250.5, },
cpk_hex = "d9ffff",
image = { title = "Vial of glowing ultrapure helium. Original size in cm: 1 x 5",
url = "https://upload.wikimedia.org/wikipedia/commons/0/00/Helium-glow.jpg",
attribution =
"Jurii, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/helium.php", },
block = "s",
}
Elements[3] = {
name = "Lithium",
appearance = "silvery-white",
atomic_mass = 6.94,
boil = 1603,
category = "alkali metal",
density = 0.534,
discovered_by = "Johan August Arfwedson",
melt = 453.65,
molar_heat = 24.86,
named_by = nil,
number = 3,
period = 2,
group = 1,
phase = "Solid",
source = "https://en.wikipedia.org/wiki/Lithium",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_003_lithium/element_003_lithium_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_003_lithium/element_003_lithium.glb",
spectral_img = nil,
summary =
"Lithium (from Greek:λίθος lithos, \"stone\") is a chemical element with the symbol Li and atomic number 3. It is a soft, silver-white metal belonging to the alkali metal group of chemical elements. Under standard conditions it is the lightest metal and the least dense solid element.",
symbol = "Li",
xpos = 1,
ypos = 2,
wxpos = 1,
wypos = 2,
shells = { 2, 1, },
electron_configuration = "1s2 2s1",
electron_configuration_semantic = "[He] 2s1",
electron_affinity = 59.6326,
electronegativity_pauling = 0.98,
ionization_energies = { 520.2, 7298.1, 11815, },
cpk_hex = "cc80ff",
image = { title = "0.5 Grams Lithium under Argon. Original size of the largest piece in cm: 0.3 x 4",
url = "https://upload.wikimedia.org/wikipedia/commons/e/e2/0.5_grams_lithium_under_argon.jpg",
attribution =
"Hi-Res Images ofChemical Elements, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/lithium.php", },
block = "s",
}
Elements[4] = {
name = "Beryllium",
appearance = "white-gray metallic",
atomic_mass = 9.01218315,
boil = 2742,
category = "alkaline earth metal",
density = 1.85,
discovered_by = "Louis Nicolas Vauquelin",
melt = 1560,
molar_heat = 16.443,
named_by = nil,
number = 4,
period = 2,
group = 2,
phase = "Solid",
source = "https://en.wikipedia.org/wiki/Beryllium",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_004_beryllium/element_004_beryllium_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_004_beryllium/element_004_beryllium.glb",
spectral_img = nil,
summary =
"Beryllium is a chemical element with symbol Be and atomic number 4. It is created through stellar nucleosynthesis and is a relatively rare element in the universe. It is a divalent element which occurs naturally only in combination with other elements in minerals.",
symbol = "Be",
xpos = 2,
ypos = 2,
wxpos = 2,
wypos = 2,
shells = { 2, 2, },
electron_configuration = "1s2 2s2",
electron_configuration_semantic = "[He] 2s2",
electron_affinity = -48,
electronegativity_pauling = 1.57,
ionization_energies = { 899.5, 1757.1, 14848.7, 21006.6, },
cpk_hex = "c2ff00",
image = { title = "Pure Beryllium bead, 2.5 grams. Original size in cm: 1 x 1.5",
url = "https://upload.wikimedia.org/wikipedia/commons/e/e2/Beryllium_%28Be%29.jpg",
attribution =
"Hi-Res Images ofChemical Elements, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/beryllium.php", },
block = "s",
}
Elements[5] = {
name = "Boron",
appearance = "black-brown",
atomic_mass = 10.81,
boil = 4200,
category = "metalloid",
density = 2.08,
discovered_by = "Joseph Louis Gay-Lussac",
melt = 2349,
molar_heat = 11.087,
named_by = nil,
number = 5,
period = 2,
group = 13,
phase = "Solid",
source = "https://en.wikipedia.org/wiki/Boron",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_005_boron/element_005_boron_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_005_boron/element_005_boron.glb",
spectral_img = nil,
summary =
"Boron is a metalloid chemical element with symbol B and atomic number 5. Produced entirely by cosmic ray spallation and supernovae and not by stellar nucleosynthesis, it is a low-abundance element in both the Solar system and the Earth's crust. Boron is concentrated on Earth by the water-solubility of its more common naturally occurring compounds, the borate minerals.",
symbol = "B",
xpos = 13,
ypos = 2,
wxpos = 27,
wypos = 2,
shells = { 2, 3, },
electron_configuration = "1s2 2s2 2p1",
electron_configuration_semantic = "[He] 2s2 2p1",
electron_affinity = 26.989,
electronegativity_pauling = 2.04,
ionization_energies = { 800.6, 2427.1, 3659.7, 25025.8, 32826.7, },
cpk_hex = "ffb5b5",
image = { title = "Pure Crystalline Boron, front and back side. Original size in cm: 2 x 3",
url = "https://upload.wikimedia.org/wikipedia/commons/a/a2/Boron.jpg",
attribution =
"Jurii, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/boron.php", },
block = "p",
}
Elements[6] = {
name = "Carbon",
appearance = nil,
atomic_mass = 12.011,
boil = nil,
category = "polyatomic nonmetal",
density = 1.821,
discovered_by = "Ancient Egypt",
melt = nil,
molar_heat = 8.517,
named_by = nil,
number = 6,
period = 2,
group = 14,
phase = "Solid",
source = "https://en.wikipedia.org/wiki/Carbon",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_006_carbon/element_006_carbon_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_006_carbon/element_006_carbon.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Carbon_Spectra.jpg",
summary =
"Carbon (from Latin:carbo \"coal\") is a chemical element with symbol C and atomic number 6. On the periodic table, it is the first (row 2) of six elements in column (group) 14, which have in common the composition of their outer electron shell. It is nonmetallic and tetravalent—making four electrons available to form covalent chemical bonds.",
symbol = "C",
xpos = 14,
ypos = 2,
wxpos = 28,
wypos = 2,
shells = { 2, 4, },
electron_configuration = "1s2 2s2 2p2",
electron_configuration_semantic = "[He] 2s2 2p2",
electron_affinity = 121.7763,
electronegativity_pauling = 2.55,
ionization_energies = { 1086.5, 2352.6, 4620.5, 6222.7, 37831, 47277, },
cpk_hex = "909090",
image = { title = "Element 6 - Carbon",
url = "https://upload.wikimedia.org/wikipedia/commons/6/68/Pure_Carbon.png",
attribution =
"Texas Lane, CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons", },
block = "p",
}
Elements[7] = {
name = "Nitrogen",
appearance = "colorless gas, liquid or solid",
atomic_mass = 14.007,
boil = 77.355,
category = "diatomic nonmetal",
density = 1.251,
discovered_by = "Daniel Rutherford",
melt = 63.15,
molar_heat = nil,
named_by = "Jean-Antoine Chaptal",
number = 7,
period = 2,
group = 15,
phase = "Gas",
source = "https://en.wikipedia.org/wiki/Nitrogen",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_007_nitrogen/element_007_nitrogen_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_007_nitrogen/element_007_nitrogen.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Nitrogen_Spectra.jpg",
summary =
"Nitrogen is a chemical element with symbol N and atomic number 7. It is the lightest pnictogen and at room temperature, it is a transparent, odorless diatomic gas. Nitrogen is a common element in the universe, estimated at about seventh in total abundance in the Milky Way and the Solar System.",
symbol = "N",
xpos = 15,
ypos = 2,
wxpos = 29,
wypos = 2,
shells = { 2, 5, },
electron_configuration = "1s2 2s2 2p3",
electron_configuration_semantic = "[He] 2s2 2p3",
electron_affinity = -6.8,
electronegativity_pauling = 3.04,
ionization_energies = { 1402.3, 2856, 4578.1, 7475, 9444.9, 53266.6, 64360, },
cpk_hex = "3050f8",
image = { title = "Vial of Glowing Ultrapure Nitrogen, N2. Original size in cm: 1 x 5",
url = "https://upload.wikimedia.org/wikipedia/commons/2/2d/Nitrogen-glow.jpg",
attribution =
"Jurii, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/nitrogen.php", },
block = "p",
}
Elements[8] = {
name = "Oxygen",
appearance = nil,
atomic_mass = 15.999,
boil = 90.188,
category = "diatomic nonmetal",
density = 1.429,
discovered_by = "Carl Wilhelm Scheele",
melt = 54.36,
molar_heat = nil,
named_by = "Antoine Lavoisier",
number = 8,
period = 2,
group = 16,
phase = "Gas",
source = "https://en.wikipedia.org/wiki/Oxygen",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_008_oxygen/element_008_oxygen_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_008_oxygen/element_008_oxygen.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Oxygen_spectre.jpg",
summary =
"Oxygen is a chemical element with symbol O and atomic number 8. It is a member of the chalcogen group on the periodic table and is a highly reactive nonmetal and oxidizing agent that readily forms compounds (notably oxides) with most elements. By mass, oxygen is the third-most abundant element in the universe, after hydrogen and helium.",
symbol = "O",
xpos = 16,
ypos = 2,
wxpos = 30,
wypos = 2,
shells = { 2, 6, },
electron_configuration = "1s2 2s2 2p4",
electron_configuration_semantic = "[He] 2s2 2p4",
electron_affinity = 140.976,
electronegativity_pauling = 3.44,
ionization_energies = { 1313.9, 3388.3, 5300.5, 7469.2, 10989.5, 13326.5, 71330, 84078, },
cpk_hex = "ff0d0d",
image = { title = "Liquid Oxygen in a Beaker",
url =
"https://upload.wikimedia.org/wikipedia/commons/a/a0/Liquid_oxygen_in_a_beaker_%28cropped_and_retouched%29.jpg",
attribution = "Staff Sgt. Nika Glover, U.S. Air Force, Public domain, via Wikimedia Commons", },
block = "p",
}
Elements[9] = {
name = "Fluorine",
appearance = nil,
atomic_mass = 18.9984031636,
boil = 85.03,
category = "diatomic nonmetal",
density = 1.696,
discovered_by = "André-Marie Ampère",
melt = 53.48,
molar_heat = nil,
named_by = "Humphry Davy",
number = 9,
period = 2,
group = 17,
phase = "Gas",
source = "https://en.wikipedia.org/wiki/Fluorine",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_009_fluorine/element_009_fluorine_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_009_fluorine/element_009_fluorine.glb",
spectral_img = nil,
summary =
"Fluorine is a chemical element with symbol F and atomic number 9. It is the lightest halogen and exists as a highly toxic pale yellow diatomic gas at standard conditions. As the most electronegative element, it is extremely reactive:almost all other elements, including some noble gases, form compounds with fluorine.",
symbol = "F",
xpos = 17,
ypos = 2,
wxpos = 31,
wypos = 2,
shells = { 2, 7, },
electron_configuration = "1s2 2s2 2p5",
electron_configuration_semantic = "[He] 2s2 2p5",
electron_affinity = 328.1649,
electronegativity_pauling = 3.98,
ionization_energies = { 1681, 3374.2, 6050.4, 8407.7, 11022.7, 15164.1, 17868, 92038.1, 106434.3, },
cpk_hex = "90e050",
image = { title = "Liquid Fluorine at -196°C",
url = "https://upload.wikimedia.org/wikipedia/commons/2/2c/Fluoro_liquido_a_-196%C2%B0C_1.jpg",
attribution =
"Fulvio314, CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0>, via Wikimedia Commons", },
block = "p",
}
Elements[10] = {
name = "Neon",
appearance = "colorless gas exhibiting an orange-red glow when placed in a high voltage electric field",
atomic_mass = 20.17976,
boil = 27.104,
category = "noble gas",
density = 0.9002,
discovered_by = "Morris Travers",
melt = 24.56,
molar_heat = nil,
named_by = nil,
number = 10,
period = 2,
group = 18,
phase = "Gas",
source = "https://en.wikipedia.org/wiki/Neon",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_010_neon/element_010_neon_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_010_neon/element_010_neon.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Neon_spectra.jpg",
summary =
"Neon is a chemical element with symbol Ne and atomic number 10. It is in group 18 (noble gases) of the periodic table. Neon is a colorless, odorless, inert monatomic gas under standard conditions, with about two-thirds the density of air.",
symbol = "Ne",
xpos = 18,
ypos = 2,
wxpos = 32,
wypos = 2,
shells = { 2, 8, },
electron_configuration = "1s2 2s2 2p6",
electron_configuration_semantic = "[He] 2s2 2p6",
electron_affinity = -116,
electronegativity_pauling = nil,
ionization_energies = { 2080.7, 3952.3, 6122, 9371, 12177, 15238, 19999, 23069.5, 115379.5, 131432, },
cpk_hex = "b3e3f5",
image = { title = "Vial of Glowing Ultrapure neon. Original size in cm: 1 x 5",
url = "https://upload.wikimedia.org/wikipedia/commons/f/f8/Neon-glow.jpg",
attribution =
"Jurii, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/neon.php", },
block = "p",
}
Elements[11] = {
name = "Sodium",
appearance = "silvery white metallic",
atomic_mass = 22.989769282,
boil = 1156.09,
category = "alkali metal",
density = 0.968,
discovered_by = "Humphry Davy",
melt = 370.944,
molar_heat = 28.23,
named_by = nil,
number = 11,
period = 3,
group = 1,
phase = "Solid",
source = "https://en.wikipedia.org/wiki/Sodium",
bohr_model_image =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_011_sodium/element_011_sodium_srp_th.png",
bohr_model_3d =
"https://storage.googleapis.com/search-ar-edu/periodic-table/element_011_sodium/element_011_sodium.glb",
spectral_img = "https://en.wikipedia.org/wiki/File:Sodium_Spectra.jpg",
summary =
"Sodium /ˈsoʊdiəm/ is a chemical element with symbol Na (from Ancient Greek Νάτριο) and atomic number 11. It is a soft, silver-white, highly reactive metal. In the Periodic table it is in column 1 (alkali metals), and shares with the other six elements in that column that it has a single electron in its outer shell, which it readily donates, creating a positively charged atom - a cation.",
symbol = "Na",
xpos = 1,
ypos = 3,
wxpos = 1,
wypos = 3,
shells = { 2, 8, 1, },
electron_configuration = "1s2 2s2 2p6 3s1",
electron_configuration_semantic = "[Ne] 3s1",
electron_affinity = 52.867,
electronegativity_pauling = 0.93,
ionization_energies = { 495.8, 4562, 6910.3, 9543, 13354, 16613, 20117, 25496, 28932, 141362, 159076, },
cpk_hex = "ab5cf2",
image = { title = "Na (Sodium) Metal",
url = "https://upload.wikimedia.org/wikipedia/commons/2/27/Na_%28Sodium%29.jpg",
attribution =
"The original uploader was Dnn87 at English Wikipedia., CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0>, via Wikimedia Commons", },
block = "s",
}
Elements[12] = {
name = "Magnesium",
appearance = "shiny grey solid",
atomic_mass = 24.305,
boil = 1363,
category = "alkaline earth metal",
density = 1.738,
discovered_by = "Joseph Black",
melt = 923,
molar_heat = 24.869,
named_by = nil,
number = 12,
period = 3,